Bugzilla – Bug 383
Warning while using shoutcast, not calculating base correctly when parsing playlists
Last modified: 2008-12-18 11:54:48 UTC
Jason Holzapple reports that he gets the following warning when using shoutcast: Use of uninitialized value in pattern match (m//) at /home/slimp3/perl/lib/5.8.4/File/Spec/Unix.pm line 255. 2004-06-17 12:30:09.2117 pathFromFileURL: http://www.shoutcast.com/sbin/tunein-station.pls? id=4022&filename=playlist.pls isn't a file URL... 2004-06-17 12:30:09.2136 Backtrace: frame 0: Slim::Utils::Misc::pathFromFileURL (/home/slimp3/slim/server/Slim/Utils/Scan.pm line 436) frame 1: Slim::Utils::Scan::readList (/home/slimp3/slim/server/Slim/Utils/Scan.pm line 124) frame 2: Slim::Utils::Scan::addToList (/home/slimp3/slim/server/Slim/Control/Command.pm line 380) frame 3: Slim::Control::Command::execute (/home/slimp3/slim/server/Plugins/ShoutcastBrowser.pm line 1063) frame 4: Plugins::ShoutcastBrowser::__ANON__ (/home/slimp3/slim/server/Slim/Hardware/IR.pm line 545) frame 5: Slim::Hardware::IR::executeButton (/home/slimp3/slim/server/Slim/Control/Command.pm line 207) frame 6: Slim::Control::Command::execute (/home/slimp3/slim/server/Slim/Hardware/IR.pm line 569) frame 7: Slim::Hardware::IR::processCode (/home/slimp3/slim/server/Slim/Hardware/IR.pm line 429) frame 8: Slim::Hardware::IR::releaseCode (/home/slimp3/slim/server/Slim/Hardware/IR.pm line 327) frame 9: Slim::Hardware::IR::checkRelease (/home/slimp3/slim/server/Slim/Utils/Timers.pm line 52) frame 10: Slim::Utils::Timers::checkTimers (slim/server/slimserver.pl line 394) frame 11: main::idle (slim/server/slimserver.pl line 364) frame 12: main::main (slim/server/slimserver.pl line 821)
I've tracked it down to not calculating the base URL correctly when parsing playlists. This might also fix problems with relative file names m3u files... Here's a patch: Index: Slim/Utils/Scan.pm =============================================================== ==== RCS file: /home/cvs/cvsroot/slim/server/Slim/Utils/Scan.pm,v retrieving revision 1.10 diff -r1.10 Scan.pm 435,436c435,447 < $::d_scan && msg("Scan::readList loading $playlisturl\n"); < $numitems = (push @$listref, Slim::Formats::Parse:: parseList($playlisturl,$playlist_filehandle, (splitpath(Slim::Utils::Misc::pathFromFileURL($playlisturl)))[0] . (splitpath(Slim::Utils::Misc::pathFromFileURL($playlisturl)))[1])) - $startingsize; --- > my $playlist_base = undef; > > if (Slim::Music::Info::isFileURL($playlisturl)) { > my $path = Slim::Utils::Misc::pathFromFileURL($playlisturl); > my @parts = splitpath($path); > pop(@parts); > $playlist_base = Slim::Utils::Misc::fileURLFromPath(catpath(@parts)); > $::d_scan && msg("gonna scan $playlisturl, with path $path, for base: $playlist_base\n"); > } > > $::d_scan && msg("Scan::readList loading $playlisturl with base $playlist_base\n"); > $numitems = (push @$listref, Slim::Formats::Parse::parseList($playlisturl, $playlist_filehandle, $playlist_base)) - $startingsize; >
Whoops, that patch was using the wrong File::Spec functions: Index: Slim/Utils/Scan.pm =============================================================== ==== RCS file: /home/cvs/cvsroot/slim/server/Slim/Utils/Scan.pm,v retrieving revision 1.10 diff -r1.10 Scan.pm 435,436c435,447 < $::d_scan && msg("Scan::readList loading $playlisturl\n"); < $numitems = (push @$listref, Slim::Formats::Parse:: parseList($playlisturl,$playlist_filehandle, (splitpath(Slim::Utils::Misc::pathFromFileURL($playlisturl)))[0] . (splitpath(Slim::Utils::Misc::pathFromFileURL($playlisturl)))[1])) - $startingsize; --- > my $playlist_base = undef; > > if (Slim::Music::Info::isFileURL($playlisturl)) { > my $path = Slim::Utils::Misc::pathFromFileURL($playlisturl); > my @parts = splitdir($path); > pop(@parts); > $playlist_base = Slim::Utils::Misc::fileURLFromPath(catdir(@parts)); > $::d_scan && msg("gonna scan $playlisturl, with path $path, for base: $playlist_base\n"); > } > > $::d_scan && msg("Scan::readList loading $playlisturl with base $playlist_base\n"); > $numitems = (push @$listref, Slim::Formats::Parse::parseList($playlisturl, $playlist_filehandle, $playlist_base)) - $startingsize; >
This Slimserver bug was fixed a very long time ago, and is now being marked as Closed. If you're still experiencing this issue, please verify you are running a current version of Slimserver and re-open the bug.
Routine bug db maintenance; removing old versions which cause confusion. I apologize for the inconvenience.