Queue Smart Playlist with Movie Sets?
#1
Question 
Let's say I have a smart playlist that includes some movie sets. When I open the contextual menu with a smart playlist selected and choose "Queue Item" or "Play", the video playlist is properly converted to a static one. (i.e. the items in the set are extracted to each be part of the list) However, if I try to queue that smart playlist through code, the sets show up as the sets themselves, not the movies within.

Is there a way to mimic XBMC's "Queue Item" functionality in Python? I've tried:

XBMC.PlayMedia()
XBMC.PlayList().add()
Both operate in the latter fashion mentioned above

XBMC.PlayList().load()
Doesn't like the format of the smart playlist

I looked up the contextual menu in the source. CGUIWindowVideoBase::OnQueueItem seems to work similarly to the PlayList.add() route, but calls CGUIWindowVideoBase::AddItemToPlayList, which appears to have some recursion magic--to handle things like folders and sets, I'm guessing--that we don't have access to in the Python library. Am I correct? Is there any way to properly convert a smart playlist to a static one?

Thanks for your time...hope I explained my question well enough...hehe
Reply
#2
i suspect you are correct, no bindings to those methods. for now you'll have to list the dir (a playlist is just a directory - do getdirectory on it) and add the items manually i guess.
Reply
#3
Thanks for the reply, and sorry for the late response...I have another question, then, if you don't mind.

GetDirectory() seems to be a JSON-RPC call, right? I can't find confirmation that executejsonapi() ever made it in. (I'm doing this within an addon, and I'd rather not require the webserver to be on.) Is there a way to use JSON-RPC in python without the server, or am I misunderstanding your suggestion entirely, perhaps? hehe

Thanks again.
Reply
#4
Sorry...a little more research and I found executeJSONRPC(). I'm guessing this is what I need then?
Reply
#5
yes, that was the idea.
Reply
#6
TheOddLinguist did an excellent job of implementing this into PseudoTV. There does seem to be one issue with it, though. spiff, you mentioned that playlists are treated as directories. When a smart playlist includes another smart playlist in its parameters, though, the JSON GetDirectory call returns an "Invalid Params" message. Is this expected, or a bug?
Reply
#7
@Jason102: Could it be a string format issue somehow? Maybe the result you get from the initial JSON call needs to be escaped?
Reply
#8
No, I output the result from the initial JSON call to the log and it outputs that error.
Reply

Logout Mark Read Team Forum Stats Members Help
Queue Smart Playlist with Movie Sets?0