Kodi Smart Playlists and JSON


#1

1) Give a description of the problem
Trying to play a playlist in Kodi by using playFile
2) What is the expected behaviour?
I have created a Smart Playlist Christmas.xsp that I am trying to get Kodi to play with a JSON call.

3) What is happening/not happening?
Will not play.

This is the log error from Kodi :
DEBUG: JSONRPC: Incoming request: {“jsonrpc”:“2.0”,“method”:“Player.Open”,“id”:1,“params”:{“item”:{“file”:“special://profile/playlists/music/Christmas.xsp”}}}

ERROR: Open - error probing input format, special://profile/playlists/music/Christmas.xsp

This is the log from Kodi when I play the playlist from within Kodi. This plays correctly.

2019-10-20 09:26:32.240 T:1467982560 DEBUG: JSONRPC: Incoming request: [{“jsonrpc”:“2.0”,“method”:“Playlist.Insert”,“params”:[0,0,{“directory”:“special://profile/playlists/music/Christmas.xsp”}],“id”:142}]

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
image


#2

I don’t have a Kodi installation but one thing I noticed from the log is the file and directory difference.


#3

@eibyer, Good thought. I tried both and it will not play my playlist. I continue to get errors in the Kodi log.


#4

I suspect my problem is related to the many options available in the playFile command related to JSON. Not sure where to even begin there.


#5

I am just spent. I have been working for 2 days trying to get a simple Smart Playlist to play in Kodi from the playFile command here in webcore.


#6

I found my answer. Previous JSON calls to Kodi to play a playlist no longer work in Kodi 18. SEE HERE. Security measures have been implemented. So this is a work around…

[{"jsonrpc": "2.0", "id": 0, "method": "Playlist.Clear", "params": {"playlistid": 0}}, {"jsonrpc":"2.0","id":0,"method":"Playlist.Add","params":{"playlistid":0,"item":{"recursive":true, "directory":"special://profile/playlists/music/zzzz.xsp"}}}, {"jsonrpc":"2.0","id":0,"method":"Player.Open","params":{"item":{"playlistid":0,"position":0}}}]

Remember to put a \ in front of all { or } to look like this :

[\{"jsonrpc": "2.0", "id": 0, "method": "Playlist.Clear", "params": \{"playlistid": 0\}\}, \{"jsonrpc":"2.0","id":0,"method":"Playlist.Add","params":\{"playlistid":0,"item":\{"recursive":true, "directory":"special://profile/playlists/music/zzzz.xsp"\}\}\}, \{"jsonrpc":"2.0","id":0,"method":"Player.Open","params":\{"item":\{"playlistid":0,"position":0\}\}\}]

I get syntax warnings in my webcore log when I execute this. BUT IT WORKS !!!
I would greatly appreciate help with the syntax warnings.


#7

playFile is not working correctly now and a JSON call is needed.
Play track appears to be working as normal.