[BACK]Return to showfiles.pl CVS log [TXT][DIR] Up to [local] / mp3 / bin

Diff for /mp3/bin/showfiles.pl between version 1.2 and 1.3

version 1.2, 2006/08/12 01:14:53 version 1.3, 2007/02/08 20:04:03
Line 1 
Line 1 
 #!/usr/bin/perl -w  #!/usr/bin/perl -w
 # $RedRiver$  # $RedRiver: showfiles.pl,v 1.2 2006/08/12 00:14:53 andrew Exp $
 ########################################################################  ########################################################################
 # GenerateMP3HTML.pl *** Generates the HTML files for the playlist.  # GenerateMP3HTML.pl *** Generates the HTML files for the playlist.
 #  #
Line 13 
Line 13 
 #my qw/ @mp3s @dirs /;  #my qw/ @mp3s @dirs /;
   
 my $basedir = '/home/mp3/Sorted';  my $basedir = '/home/mp3/Sorted';
 my $subdir = $ENV{'QUERY_STRING'};  
 my $addurl = 'addmp3playlist.pl';  my $addurl = 'addmp3playlist.pl';
   
 #######################################################################  #######################################################################
 # *** MAIN ***  # *** MAIN ***
 #######################################################################  #######################################################################
   
   my ($prefix, $subdir) = split /\&/, $ENV{'QUERY_STRING'};
 if ($subdir) {  if ($subdir) {
         $subdir =~ s/%(..)/pack("c",hex($1))/ge;          $subdir =~ s/%(..)/pack("c",hex($1))/ge;
 } else {  } else {
         $subdir ='';          $subdir ='';
 }  }
   
   if ($prefix) {
           $prefix =~ s/%(..)/pack("c",hex($1))/ge;
   } else {
           $prefix ='';
   }
   
 my @dirs = GetDirListing("$basedir/$subdir");  my @dirs = GetDirListing("$basedir/$subdir");
 my @mp3s = GetMP3Listing("$basedir/$subdir");  my @mp3s = GetMP3Listing("$basedir/$subdir");
   
Line 38 
Line 44 
 if ($subdir) {  if ($subdir) {
         print "<h3>";          print "<h3>";
         SplitDir($subdir);          SplitDir($subdir);
         print " - <font size=\"-2\"><a href=\"" . "showall.pl" . "\?" . EncodeURL("$subdir") . "\">All</a></font>";          print " - <font size=\"-2\"><a href=\"" . "showall.pl" . "\?" . EncodeURL($prefix) . '&' . EncodeURL("$subdir") . "\">Show</a></font>";
         print " - <font size=\"-2\"><a href=\"" . "addall.pl" . "\?" . EncodeURL("$subdir") . "\">Add</a></font><br>";          print " - <font size=\"-2\"><a href=\"" . "addall.pl" . "\?" . EncodeURL($prefix) . '&' . EncodeURL("$subdir") . "\">Play</a></font>";
           print " - <font size=\"-2\"><a href=\"" . "addall.pl" . "\?" . EncodeURL($prefix) . '&' . EncodeURL("$subdir") . '&' . EncodeURL('fulllist.lst') . "\">Approve</a></font>" if $prefix;
           print "<br>\n";
         print "</h3>\n";          print "</h3>\n";
         print "<hr>\n";          print "<hr>\n";
 }  }
   
 if (@dirs) {  if (@dirs) {
         foreach my $dir (@dirs) {          foreach my $dir (@dirs) {
                 print "<a href=\"" . MyName() . "\?" . EncodeURL("$subdir/$dir") . "\">$dir</a> ";                  print "<a href=\"" . MyName() . "\?" . EncodeURL($prefix) . '&' . EncodeURL("$subdir/$dir") . "\">$dir</a> ";
                 print "- <font size=\"-2\"><a href=\"" . "showall.pl" . "\?" . EncodeURL("$subdir/$dir") . "\">All</a></font>";                  print "- <font size=\"-2\"><a href=\"" . "showall.pl" . "\?" . EncodeURL($prefix) . '&' . EncodeURL("$subdir/$dir")  . "\">Show</a></font>";
                 print "- <font size=\"-2\"><a href=\"" . "addall.pl" . "\?" . EncodeURL("$subdir/$dir") . "\">Add</a></font><br>";                  print "- <font size=\"-2\"><a href=\"" . "addall.pl" . "\?" . EncodeURL($prefix) . '&' . EncodeURL("$subdir/$dir") . "\">Play</a></font>";
                   print "- <font size=\"-2\"><a href=\"" . "addall.pl" . "\?" . EncodeURL($prefix) . '&' . EncodeURL("$subdir/$dir") . '&' . EncodeURL('fulllist.lst') . "\">Approve</a></font>" if $prefix;
                   print "<br>\n";
         }          }
 }  }
   
Line 72 
Line 82 
                 }                  }
   
                 $songtitle =~ s/\.(mp3|ogg)$//i;                  $songtitle =~ s/\.(mp3|ogg)$//i;
                 print "<a href=\"$addurl\?" . EncodeURL("$subdir/$mp3") . "\" target=\"bottom\">$songtitle</a></li>\n";                  print "<a href=\"$addurl\?" . EncodeURL($prefix) . '&' . EncodeURL("$subdir/$mp3") . "\" target=\"bottom\">$songtitle</a>";
                   print " - <a href=\"$addurl\?" . EncodeURL($prefix) . '&' . EncodeURL("$subdir/$mp3") . '&' . EncodeURL('fulllist.lst') . "\" target=\"bottom\">Approve</a>" if $prefix;
                   print "</li>\n";
         }          }
         print "</ul>\n";          print "</ul>\n";
 }  }
Line 156 
Line 168 
                         for ($j=0;$j<=$i;$j++) {                          for ($j=0;$j<=$i;$j++) {
                                 $url = "$url/$filename[$j]";                                  $url = "$url/$filename[$j]";
                         }                          }
                 print "/<a href=\"showfiles.pl\?" . EncodeURL($url) . "\">$filename[$i]</a>";                  print "/<a href=\"showfiles.pl\?" . EncodeURL($prefix) . '&' . EncodeURL($url) . "\">$filename[$i]</a>";
   
                 }                  }
         } else {          } else {

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>