Bug 1727 - playlist, add command broken in 6.1
: playlist, add command broken in 6.1
Status: RESOLVED WORKSFORME
Product: Logitech Media Server
Classification: Unclassified
Component: Playlists
: 6.1.0
: PC All
: P2 normal (vote)
: Future
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-29 03:27 UTC by James Craig
Modified: 2005-08-10 21:26 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Craig 2005-06-29 03:27:51 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.
Comment 1 KDF 2005-06-29 10:05:33 UTC
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.
Comment 2 James Craig 2005-06-29 10:13:03 UTC
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?
Comment 3 James Craig 2005-06-30 02:20:25 UTC
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? 
Comment 4 KDF 2005-06-30 09:38:57 UTC
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' ?
Comment 5 James Craig 2005-06-30 09:45:25 UTC
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.
Comment 6 KDF 2005-06-30 13:49:03 UTC
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.
Comment 7 KDF 2005-07-13 02:22:11 UTC
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)

Comment 8 James Craig 2005-07-13 02:36:49 UTC
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...
Comment 9 KDF 2005-07-13 03:38:55 UTC
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.
Comment 10 KDF 2005-08-10 21:26:24 UTC
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.