From dabff11bcdaf22ae9f2df6dd50aef866cfdbbc42 Mon Sep 17 00:00:00 2001 From: TheTroll Date: Thu, 25 Feb 2010 00:23:25 +0100 Subject: Fixed PL generation --- genplaylist.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/genplaylist.php b/genplaylist.php index a30333d..7886ecb 100755 --- a/genplaylist.php +++ b/genplaylist.php @@ -16,16 +16,8 @@ { $found = 0; while ($medianame = readdir($dir_handle)) - { if (mediagettype($path .$medianame) == 2) - { - if ($medianame == $name) - $found = 1; - - if ($found) - $medianame_array[] = $medianame; - } - } + $medianame_array[] = $medianame; if ($medianame_array[0]) { @@ -39,8 +31,15 @@ else { $count = count($medianame_array); + $found = 0; for ($cnt=0; $cnt < $count; $cnt++) - fwrite($plfile, "playlist/" .$medianame_array[$cnt] ."\n"); + { + if ($medianame_array[$cnt] == $name) + $found=1; + + if ($found) + fwrite($plfile, "playlist/" .$medianame_array[$cnt] ."\n"); + } fclose($plfile); -- cgit v1.2.3