From ff270318f7859bb99de1dc679ad3093c31f304dd Mon Sep 17 00:00:00 2001 From: TheTroll Date: Wed, 24 Feb 2010 17:20:04 +0100 Subject: Now redirect single files to playlist frontend (still buggy, file is not played yert) Remove audiotypes conf (we only support native safari ext) --- config_default.php | 1 - includes/inc_media.php | 26 +++++++++++++++++--------- includes/inc_mp3.php | 7 ++++++- streammusic.php | 18 ------------------ 4 files changed, 23 insertions(+), 29 deletions(-) delete mode 100755 streammusic.php diff --git a/config_default.php b/config_default.php index f02d272..6491d02 100755 --- a/config_default.php +++ b/config_default.php @@ -16,7 +16,6 @@ // Media configuration $mediainfopath='/usr/bin/mediainfo'; $videotypes='avi mkv ts mov mp4 wmv flv mpg mpeg mpeg2 mpv'; //video files extensions - $audiotypes='mp3 wav aac flac'; //audio files extensions // Source name Source path $mediasources=array ( 'Video' => '/mnt/media/movies', 'Audio' => '/mnt/media/music'); diff --git a/includes/inc_media.php b/includes/inc_media.php index 441ce3f..d0f94c1 100755 --- a/includes/inc_media.php +++ b/includes/inc_media.php @@ -1,6 +1,7 @@ "; print "
  • Current path:

    {$subdir}

  • "; // Option to play dir +$audioextarray = explode(' ', $audiotypes); +$playlist = 0; +foreach ($audioextarray as $num => $audioext) +{ + if (glob($mediapath .$subdir .'*.' .$audioext)) + $playlist = 1; +} -if (glob($mediapath .$subdir ."*.mp3")) +if ($playlist) { print "
  • \r\n"; print " \r\n"; @@ -63,6 +71,8 @@ if ($medianame_array[0]) { // Alphabetical sorting sort($medianame_array); + + $audiocnt=0; foreach($medianame_array as $value) { @@ -88,9 +98,7 @@ if ($medianame_array[0]) $fileext = end(explode(".", $value)); // Check if it is supported - if ( preg_match("/" .$fileext ." /", $videotypes) - || preg_match("/" .$fileext ." $/", $videotypes) - ) + if ( preg_match("/" .$fileext ." /", $videotypes) || preg_match("/" .$fileext ." $/", $videotypes) ) { print "
  • \r\n"; print " \r\n"; @@ -106,12 +114,12 @@ if ($medianame_array[0]) print " "; print "\r\n"; } - else if ( preg_match("/" .$fileext ." /", $audiotypes) - || preg_match("/" .$fileext ."$/", $audiotypes) - ) + else if ( preg_match("/" .$fileext ." /", $audiotypes) || preg_match("/" .$fileext ."$/", $audiotypes) ) { + $audiocnt++; + print "
  • \r\n"; - print " \r\n"; + print " \r\n"; print " \r\n"; print " $value\r\n"; print " \r\n"; diff --git a/includes/inc_mp3.php b/includes/inc_mp3.php index 162ebcb..9e3cd62 100755 --- a/includes/inc_mp3.php +++ b/includes/inc_mp3.php @@ -1,6 +1,11 @@ \r\n"; +$play =$_REQUEST['play']; +if ($play == "") + print "\r\n"; +else + print "\r\n"; + print "
    \r\n"; print "
    \r\n"; print " Back\r\n"; diff --git a/streammusic.php b/streammusic.php deleted file mode 100755 index 8dbcbfe..0000000 --- a/streammusic.php +++ /dev/null @@ -1,18 +0,0 @@ - -- cgit v1.2.3