Radio-dodsorfas/web/playlist.php

28 lines
650 B
PHP
Raw Permalink Normal View History

2018-10-20 23:58:40 +02:00
<?
include 'common.php';
2018-10-21 12:53:10 +02:00
header('Content-type: audio/x-mpegurl');
2018-10-21 14:18:53 +02:00
$files = scanDir::scan('/playlists/normal', "m3u", false);
$files = array_merge($files, scanDir::scan('/playlists/normal/Daniel', "m3u", false));
$files = array_merge($files, scanDir::scan('/playlists/normal/Joakim', "m3u", false));
$files = array_merge($files, scanDir::scan('/playlists/normal/artists', "m3u", false));
2018-10-20 23:58:40 +02:00
echo "#EXTM3U\n";
foreach($files as $file) {
$filename = $file;
$file = file($file);
$file = array_slice($file, 1);
2018-10-21 12:53:10 +02:00
echo "\n#$filename\n";
2018-10-20 23:58:40 +02:00
foreach($file as $line) {
2018-10-21 12:53:10 +02:00
echo "$line";
if (substr($line, -1) !== "\n")
echo "\n";
2018-10-20 23:58:40 +02:00
}
}
?>