summaryrefslogtreecommitdiff
path: root/genplaylist.php
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-02-25 00:23:25 +0100
committerTheTroll <trolldev@gmail.com>2010-02-25 00:23:25 +0100
commitdabff11bcdaf22ae9f2df6dd50aef866cfdbbc42 (patch)
tree3244c83307238f4ff2e89bedfe0d1c33ef79d615 /genplaylist.php
parente7a66146a477408936c239739f2de6c88c6cbb5e (diff)
downloadistreamdev-dabff11bcdaf22ae9f2df6dd50aef866cfdbbc42.tar.gz
istreamdev-dabff11bcdaf22ae9f2df6dd50aef866cfdbbc42.tar.bz2
Fixed PL generation
Diffstat (limited to 'genplaylist.php')
-rwxr-xr-xgenplaylist.php19
1 files 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);