Bugzilla – Bug 366
Music library scan can't handle directory that's all whitespace
Last modified: 2008-12-18 11:54:20 UTC
The music folder scan goes into an infinite loop if you have a directory named " ". Yes, I know that's a weird thing to do, but iTunes did it for me because that's what the id3 tag said. The problem is that URI->new() strips trailing whitespace, so URI->new("file:///mp3/foo/ ") turns into just looking at /mp3/foo again. I looked at trying to url-escape the args to fixPath but then some other things started getting double- escaped. Maybe someone who knows this code better can help. Just make a directory named " " inside your music library. The debugging ends up looking like 2004-06-10 21:30:59.3814 Descending into file:///big/mp3/billo/Brian%20Setzer%20Orchestra/, contains 1 items 2004-06-10 21:30:59.3827 numitems: 142 2004-06-10 21:30:59.3837 index: 0 2004-06-10 21:30:59.3852 *****fixed: to file:///big/mp3/billo/ Brian%20Setzer%20Orchestra/ 2004-06-10 21:30:59.3861 *****base: /big/mp3/billo/Brian Setzer Orchestra/ 2004-06-10 21:30:59.3870 itempath: and file:///big/mp3/billo/ Brian%20Setzer%20Orchestra/ made file:///big/mp3/billo/Brian%20Setzer%20Orchestra/ 2004-06-10 21:30:59.3879 isList(file:///big/mp3/billo/Brian%20Setzer%20Orchestra/) == dir Here is a hack of a patch to prevent this particular infinite loop. Index: Slim/Utils/Scan.pm =============================================================== ==== RCS file: /cvsroot/slim/server/Slim/Utils/Scan.pm,v retrieving revision 1.10 diff -u -r1.10 Scan.pm --- Slim/Utils/Scan.pm 13 May 2004 17:57:36 -0000 1.10 +++ Slim/Utils/Scan.pm 11 Jun 2004 05:06:20 -0000 @@ -271,6 +271,15 @@ my $itempath = Slim::Utils::Misc::fixPath($item, $curdirState->path); $::d_scan && msg("itempath: $item and " . $curdirState->path . " made $itempath\n"); + # XXX + # fixPath (really URI) strips trailing spaces from $item. + # if $item is all spaces, that means we just get the path again + # so break this loop. This should be removed when fixPath + # gets fixed. + if ($curdirState->path eq $itempath) { + return 1; + } + ######### If it's a directory or playlist and we're recursing, push it onto the stack, othwerwise add it to the list $::d_scan && msg("isList(".$itempath.") == ".Slim::Music::Info::isList($itempath)."\n");
This bug still exists in today's CVS HEAD. It'd be nice to see the workaround committed.
Vidur, can you can consider this for 5.4?
Workaround committed on 11/3/04.
in fact, looks like line 88 of Playlist.pm isn't even needed since the setMode($client,'home'); call automatically goes to the "NOW_PLAYING" menu item
argh...hate how this skips forward. ignore that :)
Dan suggests that this is fixed in latest itunes. if not, then the itunes xml importer needs to convert spaces in URLs to %20 encoding.
*** Bug 438 has been marked as a duplicate of this bug. ***
Bill: is this still happening with the latest nightly with the latest version of iTunes? If not, can you reopen the bug? Thanks.
Routine bug db maintenance; removing old versions which cause confusion. I apologize for the inconvenience.