Bugzilla – Bug 1727
playlist, add command broken in 6.1
Last modified: 2005-08-10 21:26:24 UTC
See discussion on developers mailing list. Have been using this command for some time with no problems, broken in 6.1 around the same time as the 'playlists in database' changes were merged. (may not be connected) e.g. Slim::Control::Command::execute( $client, [ 'playlist', 'add', $file] ); gives output like this when called with file or db object: 2005-06-24 20:06:50.8871 PartyShuffle: adding file:///E:/David%20Holmes/Let%27s%20Get%20Killed/02%20My%20Mate%20Paul.m4a to Slim::Player::SoftSqueeze=ARRAY(0x3849920) 2005-06-24 20:06:50.8883 Executing command 25:81:b0:4a:7c:0d: playlist (add) (file:///E:/David%20Holmes/Let%27s%20Get%2 0Killed/02%20My%20Mate%20Paul.m4a) () () () () () Use of uninitialized value in string eq at /PerlApp/Slim/Utils/Scan.pm line 203. Use of uninitialized value in string eq at /PerlApp/Slim/Utils/Scan.pm line 203. Use of uninitialized value in pattern match (m//) at /PerlApp/Slim/Utils/Scan.pm line 526. 2005-06-24 20:06:50.8937 Null track request! 2005-06-24 20:06:50.8953 Backtrace: frame 0: Slim::DataStores::DBI::DBIStore::objectForUrl (/PerlApp/Slim/Utils/Scan.pm line 542) frame 1: Slim::Utils::Scan::readList (/PerlApp/Slim/Utils/Scan.pm line 209) frame 2: Slim::Utils::Scan::addToList_run (/PerlApp/Slim/Utils/Scan.pm line 149) frame 3: Slim::Utils::Scan::addToList (/PerlApp/Slim/Control/Command.pm line 989) frame 4: Slim::Control::Command::execute (C:/Program Files/SlimServer6/server/Plugins/iTunesPartyShuffle.pm line 356) frame 5: Plugins::iTunesPartyShuffle::addPartyShuffleTrack (C:/Program Files/SlimServer6/server/Plugins/iTunesPartySh uffle.pm line 156) frame 6: Plugins::iTunesPartyShuffle::__ANON__ (/PerlApp/Slim/Hardware/IR.pm line 662) frame 7: Slim::Hardware::IR::executeButton (/PerlApp/Slim/Control/Command.pm line 588) frame 8: Slim::Control::Command::execute (/PerlApp/Slim/Player/Client.pm line 1001) frame 9: Slim::Player::Client::execute (/PerlApp/Slim/Hardware/IR.pm line 675) frame 10: Slim::Hardware::IR::processCode (/PerlApp/Slim/Hardware/IR.pm line 538) frame 11: Slim::Hardware::IR::releaseCode (/PerlApp/Slim/Hardware/IR.pm line 431) frame 12: Slim::Hardware::IR::checkRelease (/PerlApp/Slim/Utils/Timers.pm line 100) frame 13: Slim::Utils::Timers::checkTimers (slimserver.pl line 634) frame 14: main::idle (slimserver.pl line 572) frame 15: main::main (slimserver.pl line 61) frame 16: PerlSvc::Interactive (perlsvc.pl line 1485) frame 17: PerlSvc::_interactive (slimserver.pl line 0) frame 18: (eval) (slimserver.pl line 0) Use of uninitialized value in open at /PerlApp/Slim/Utils/Scan.pm line 636.
This looks just like output I'd expect for an invalid URL, so what is different about the URL in comparison to what the command is expecting? do you have a d_info log? compare this to a d_info from a scan when this particular song is referenced.
in one instance, if I changed to using: $client->execute(['playlist','play',$url); with the same URL it works fine. So I assume no problem with the URL. It also doesn't work if you pass in the database object found using the URL - which I would understand to mean a) the URL is valid and b) no scanning is required?
when I got home last night I couldn't get any streaming stations to play. (tried all the internet radio plugins) All of them were throwing up this error. (Which is in itself wierd, why are internet streams calling the scan function?) When I installed the latest nightly and restarted, the problem went away. So I wonder if this is actually some other problem manifesting itself, and every time I make a change and subsequently restart SlimServer it goes away?
this is the result of the playlist add command: Slim::Utils::Scan::addToList(Slim::Player::Playlist::playList($client), $path, 1, undef, \&load_done, $client, $jumptoindex, $callbackf, $callbackargs, This is why the scan function is called for this case. It is all part of the backward compatibility. I'd personally recommend avoiding use of the 'add' command for any new work. I'm surprised that the difference between 'add' and 'play' is so marked. The code is exactly the same with the exception of clearing the old playlist. were you unable to make use of 'addtracks' ?
Yes "playlist, addtracks" is working fine Requires an extra couple of calls to get the ids from the database that I wasn't making before though.
well, I think I know which solution I'd go for :) as a test, I reverted my Random plugin to use 'add'. It seems to work without a problem. you can change line 104 to match if you wish to test yourself: #Slim::Control::Command::execute($client, ["playlist", "addtracks", "$type=".$item->id()]); Slim::Control::Command::execute($client, ["playlist", "add", $item]); There is clearly something else at play here, but I can't for the life of me think exactly what could be causing that output with a valid url.
have you tried this with a url command like so: http://serverip:9000/status.html?p0=playlist&p1=add&p2=file:///E:/David%20Holmes/Let%27s%20Get%20Killed/02%20My%20Mate%20Paul.m4a or even: http://serverip:9000/status.html?p0=playlist&p1=add&p2=file:///E:/David Holmes/Let's Get Killed/02 My Mate Paul.m4a just grasping as straws on this, because I just started using playlist add to solve another bug and its working fine (albeit, that case is remote URLs)
nope! I do have all my plugins working fine so this is not really an issue. If I get time I will retry the add command - I feel it was some other problem behind this...
my gut feeling was that this is probably just another odd character problem. will probably go away as a side effect of another fix. Since this is not a pressing problem, taking it off the 6.1 list. Dan may want to close, or leave for later.
fishbone/default/en/handheld skins all use add command to handle radio station urls in playlists, so it seems to work for the general case. re-open or create a new bug if a specific reproducable case comes along.