=================================================================== RCS file: /cvs/mp3/bin/addall.pl,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- mp3/bin/addall.pl 2006/03/02 23:20:47 1.1.1.1 +++ mp3/bin/addall.pl 2007/02/08 20:04:03 1.3 @@ -1,4 +1,5 @@ #!/usr/bin/perl -w +# $RedRiver: addall.pl,v 1.2 2006/08/12 00:14:53 andrew Exp $ ######################################################################## # showall.pl *** Displays all MP3's in all subdirs # @@ -12,8 +13,6 @@ #my qw/ %mp3s %dirs /; my $basedir = '/home/mp3/Sorted'; -my $subdir = $ENV{'QUERY_STRING'}; -my $playlist = '/var/www/mp3/playlist/playlist.lst'; my $countdir = 0; my $countmp3 = 0; @@ -21,12 +20,25 @@ # *** MAIN *** ####################################################################### -if ($subdir) { - $subdir =~ s/%(..)/pack("c",hex($1))/ge; +my ($prefix, $subdir, $playlist) = split /\&/, $ENV{'QUERY_STRING'}; +if ($subdir) { + $subdir =~ s/%(..)/pack("c",hex($1))/ge; } else { - $subdir =''; + $subdir =''; } +if ($playlist) { + $playlist =~ s/%(..)/pack("c",hex($1))/ge; +} else { + $playlist = 'playlist.lst'; +} +if ($prefix) { + $prefix =~ s/%(..)/pack("c",hex($1))/ge; +} else { + $prefix =''; +} + +my $playlist = '/var/www/mp3/playlist/' . $prefix . $playlist; #$basedir = $basedir . "/" . $subdir; print "Content-Type: text/html\n\n"; @@ -50,7 +62,7 @@ # my $count; # my @sorted = sort { lc($dirs{$a}) cmp lc($dirs{$b}) } (keys %dirs); # foreach my $dir (@sorted) { -# print "$dirs{$dir}
"; +# print "$dirs{$dir}
"; # $count++; # } # print "Total dirs displayed: $count

\n"; @@ -62,7 +74,7 @@ # my $count; # foreach my $mp3dir (sort keys %mp3s) { # foreach $mp3 (@{ $mp3s{$mp3dir} }) { -# print "\t

  • Song: $mp3
  • \n"; +# print "\t
  • Song: $mp3
  • \n"; # $count++; # } # } @@ -95,8 +107,8 @@ print "