Kodi Community Forum

Full Version: Using Json Commands to View a Playlist
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The title kind of says it all, am a little new to all this, but have figured out everything else that I'm after and i seem to be able to do everything else with playlist, except view the list so i can select an item.

For clarification and not sure if it matters, its a smart Video playlist that im after.

Thanks in advance
You need to access the playlists as they where files using Files.GetDirectory

To get a list of all playlists:
Code:
http://localhost:8080/jsonrpc?request={"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"special://musicplaylists"},"id":6}

To see the playlist content you need to call Files.GetDirectory using one of the directories (playlists) returned by the above request
Iv managed to use all that to return all the items on the playlist as a list in my browser window.

But what I was hoping to achieve was just to display that playlist on xbmc itself, as it appears when you select a playlist from the GUI

Thanks.

ps. what is the "id":6 at the end of that code? I've been using "id":1 for everything I've done?
Something like this should display the desired playlist on the screen

Code:
http://localhost:8080/jsonrpc?request={"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"musiclibrary", "parameters" : ["special://profile/playlists/music/"]},"id":2}

As "id" you can select whatever number you want. The response will return the same id so you can match it to the request in case you send multiple requests at the same time

To actually add the playlist content to the queue you should be able to use Playlist.Add
Im so close i can taste it!

Using the following i can get a list of all my video playlists

Code:
http://localhost:8080/jsonrpc?request={"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"videolibrary", "parameters" : ["special://profile/playlists/video/"]},"id":2}


But adding in the playlist name from there just returns a blank screen, almost like looking at a playlist that doesnt exist.

Code:
http://localhost:8080/jsonrpc?request={"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"videolibrary", "parameters" : ["special://profile/playlists/video/newmovies/"]},"id":2}

have also tried a couple of other options using different paths.

Any suggestions?
You need to use the directory which is returned by Files.GetDirectory...

For smartplaylists they end with .xsp

http://localhost:8080/jsonrpc?request={"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"videolibrary", "parameters" : ["special://profile/playlists/video/newmovies.xsp"]},"id":2}
Got a bit carried away once I got it working and forgot to thank you!

So thanks so much! Appreciate your patience!