Kodi Community Forum

Full Version: Playlist.Add issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,

Been going around in circles with this one for a good hour or so now, so thought I'd ask for some help!

I'm unable to get a movie to play when I use the filename in Playlist.Add. I should add, it's fine when I use a movieID. But I'd rather use a file so I can use it for the TV Shows as well.


I start by clearing the playlist:

{"jsonrpc": "2.0", "id": 0, "method": "Playlist.Clear", "params": {"playlistid": 1}}

Then add to the playlist, using the filepath

{"jsonrpc": "2.0", "id": 1, "method": "Playlist.Add", "params": {"playlistid": 1, "item": {"file": "C:\Users\Home Theatre\Desktop\Movies\test\test.mkv"}}}

Then, open the playlist:

{"jsonrpc": "2.0", "id": 2, "method": "Player.Open", "params": {"item": {"playlistid": 1}}}


Long and short is that nothing is happening, getting no response back from XBMC, so finding this really hard to debug.

I'm using post rather than get, so am I right in thinking I don't need to URL encode?

Any advice welcome, especially if there's any easier way of achieving this that I don't know about.

Cheers

Dave
(2013-09-30, 23:39)vidtech Wrote: [ -> ]{"jsonrpc": "2.0", "id": 1, "method": "Playlist.Add", "params": {"playlistid": 1, "item": {"file": "C:\Users\Home Theatre\Desktop\Movies\test\test.mkv"}}}
Try using double backslashes in the path:
Code:
"C:\\Users\\Home Theatre\\Desktop\\Movies\\test\\test.mkv"

jonib
What jonib said. And you should always get a reaponse from XBMC for JSON-RPC requests as long as you specify an "id". Using Playlist.GetItems after the Add will also tell you if the add actually worked.
Thanks for the advice Smile

It seems that adding the double slashes didn't work.

Although, something I've noticed, when I specify the path above (with the double slashes) when I output the JSON response (coding in xcode btw) it's outputs (null), however if I url encode the path, I get the following response from XBMC, albeit it doesn't play the file:

{
id = 1;
jsonrpc = "2.0";
method = "Playlist.Add";
params = {
item = {
file = "C:%5CUsers%5CHome%20Theatre%5CDesktop%5CMovies%5Ctest%5Ctest.mkv";
};
playlistid = 1;
};
}

Do you think it's spaces or something else in the file path causing the issue?
Something must be wrong with your setup. If you send a Playlist.Clear to XBMC's JSON-RPC API you should get a JSON-RPC message saying that the result is "OK". The same should happen for Playlist.Add if it works, otherwise you should get an "Invalid Params" error message. What you posted above does not look like a JSON-RPC response.