===================================================================
RCS file: /cvs/mp3/bin/addall.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mp3/bin/addall.pl 2006/08/12 01:14:53 1.2
+++ mp3/bin/addall.pl 2007/02/08 20:04:03 1.3
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
-# $RedRiver$
+# $RedRiver: addall.pl,v 1.2 2006/08/12 00:14:53 andrew Exp $
########################################################################
# showall.pl *** Displays all MP3's in all subdirs
#
@@ -13,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;
@@ -22,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";
@@ -51,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"; @@ -63,7 +74,7 @@ # my $count; # foreach my $mp3dir (sort keys %mp3s) { # foreach $mp3 (@{ $mp3s{$mp3dir} }) { -# print "\t