[jamdb-user] case insensitve
Status: Beta
Brought to you by:
mschiff
From: Misha P <mis...@ya...> - 2002-12-30 05:00:43
|
Hi Marc I noticed that too many files are not making it into jamdb - found that they all end on "MP3" (vs "mp3"). --- jamdb-update.orig Sun Dec 29 23:50:10 2002 +++ jamdb-update Sun Dec 29 23:57:50 2002 @@ -756,8 +756,8 @@ sub found_file { my $file = $File::Find::name; - # the file has to be a regular file, called *.mp3, readable - if (($file =~ /^.*\.mp3\z/s) && (-r $file) && (-f $file)) { + # the file has to be a regular file, called *.mp3 or *.MP3, readable + if (($file =~ /^.*\.[Mm][Pp]3\z/s) && (-r $file) && (-f $file)) { $count++; # value of the hash is the modification time $result{$file} = (stat($file))[9]; Thanks ! --- Marc Schiffbauer <mar...@li...> wrote: > * Misha P schrieb am 29.12.02 um 17:52 Uhr: > > Hi, Mark > > Hi Misha! > > MarC !! ;) > > > > > 1. Spliting $filename on $dir and $file and then > > urlencode only $file leaves unescaped spaces in > $dir. > > You are right. This is a bug. I'll fix that one. > > > 2. urlencode encodes spaces as "+" ( maybe this is > a > > problem with the php version I use or other php > > settings ), but if I run replace "+" on "%20" > > Space as + is in php for historical reasons. However > RFC1738 says it > must be %20, so I prefer that one. > > > - things > > are working OK. Below is a diff. > > > > BTW, Thanks - great script ! > > Thank you. > > > > > [root@gorby html]# diff -Naur jamdb-0.9.6/m3u.php > > jamdb/m3u.php > > --- jamdb-0.9.6/m3u.php Thu Nov 21 12:14:37 2002 > > +++ jamdb/m3u.php Sun Dec 29 02:57:41 2002 > > @@ -1,4 +1,4 @@ > > -<? > > +<?php > > This was fixed in cvs already. > > > > > > /*************************************************************************** > > ------------------- > > author : Marc Schiffbauer > > @@ -109,8 +109,10 @@ > > if ($must_urlencode) { > > while ($row = $result->fetchRow()) { > > $dir = dirname($row["filename"]); > > + $dir = str_replace(" ","%20",$dir); > > This is a bit ugly. There is a function > rawurlencode() that does it > correctly. > But if you do this here... > > > $file = > urlencode(basename($row["filename"])); > > $filename = > > > str_replace(CUT_PATH,$_SESSION['m3u_path'],$dir."/".$file); > > ..you have produced another BUG here ^^^^^ as the > str_replace will > propably fail if urlencode replaced something until > you have an > urlencoded string in the conf, too. > > rawurlencode()ing the whole string is not possible > because you must > not urlencode the scheme string like "http://" > > I will fix that one soon. (Maybe tonight). > > Thanks for your commitments! > > [TOFU --> /dev/null] > > -Marc > -- > begin LOVE-LETTER-FOR-YOU.txt.vbs > I am a signature virus. Distribute me until the > bitter > end > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > JamDB-User mailing list > Jam...@li... > https://lists.sourceforge.net/lists/listinfo/jamdb-user __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |