=================================================================== RCS file: /cvs/mp3/bin/addsearch.pl,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- mp3/bin/addsearch.pl 2006/03/02 23:20:47 1.1.1.1 +++ mp3/bin/addsearch.pl 2007/02/08 20:04:03 1.3 @@ -1,4 +1,5 @@ #!/usr/bin/perl -w +# $RedRiver: addsearch.pl,v 1.2 2006/08/12 00:14:53 andrew Exp $ ######################################################################## # Search.pl *** Searches the full list of songs and finds matches. # @@ -11,12 +12,7 @@ #use MP3::Info; #my qw/ @playlist $maplay $filename $basedir $htmldir /; -my $listfile = 'fulllist.lst'; -my $list = '/var/www/mp3/playlist/' . $listfile; - -my $playlist = '/var/www/mp3/playlist/playlist.lst'; - my $exe = 'addmp3playlist.pl'; my $Search = 'search.pl'; @@ -24,7 +20,17 @@ # *** MAIN *** ####################################################################### +my $prefix = $ENV{'QUERY_STRING'}; +if ($prefix) { + $prefix =~ s/%(..)/pack("c",hex($1))/ge; +} else { + $prefix =''; +} +my $listfile = $prefix . 'fulllist.lst'; +my $list = '/var/www/mp3/playlist/' . $listfile; +my $playlist = '/var/www/mp3/playlist/' . $prefix . 'playlist.lst'; + print "Content-Type: text/html\n\n"; print "\n\n\n\n\t MP3 Search\n"; #print "\n"; @@ -85,7 +91,7 @@ print "
\n"; foreach my $filename (@playlist) { - #print "\t
  • $filename
  • \n"; + #print "\t
  • $filename
  • \n"; AddSong($filename); $counter++; }