Bug 383 - Warning while using shoutcast, not calculating base correctly when parsing playlists
: Warning while using shoutcast, not calculating base correctly when parsing pl...
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Playlists
: 5.x or older
: All All
: P2 normal (vote)
: ---
Assigned To: Blackketter Dean
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-06-17 13:29 UTC by Blackketter Dean
Modified: 2008-12-18 11:54 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Blackketter Dean 2004-06-17 13:29:02 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)
Comment 1 Blackketter Dean 2004-06-17 13:29:57 UTC
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;
> 
Comment 2 Blackketter Dean 2004-06-17 14:31:28 UTC
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;
> 
Comment 3 Chris Owens 2007-05-24 15:54:10 UTC
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.
Comment 4 Chris Owens 2008-12-18 11:54:48 UTC
Routine bug db maintenance; removing old versions which cause confusion.  I apologize for the inconvenience.