2013-11-11, 05:50
I'm trying to update my addons to make full use of the json rpc but I can't figure out how to set the properties of a playlist item.
I can use:
{"jsonrpc": "2.0", "method": "Playlist.Getitems", "params": {"playlistid": 1, "properties": ["title", "album", "artist", "plot", "year", "genre","season", "episode", "duration", "showtitle", "tvshowid", "thumbnail", "file", "fanart", "streamdetails"]}, "id":1}
to read the playlist items properties, even if they're not in the library, but I can't get the Playlist.Add method to set the properties and can't find another method which does it.
{"jsonrpc": "2.0", "method": "Playlist.Add", "params": {"playlistid": 1, "item":{"file":"C:/Users/TV/AppData/Roaming/XBMC/userdata/something.mp4"}}, "id":1}
works to set the playlist item file, but how do you set the other properties?
I'm trying to change the following existing code to the json interface:
u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)
liz=xbmcgui.ListItem(name, iconImage=dir_image, thumbnailImage=iconimage)
liz.setInfo( type="Video", infoLabels={ "Title": name, "Plot": description, "Genre": genre, "Year": date } )
liz.setProperty( "Fanart_Image", fanart )
liz.addContextMenuItems(contextMenu_)
xbmc.PlayList(1).add(u, liz)
How can I accomplish this with the json rpc api? Thanks in advance.
I can use:
{"jsonrpc": "2.0", "method": "Playlist.Getitems", "params": {"playlistid": 1, "properties": ["title", "album", "artist", "plot", "year", "genre","season", "episode", "duration", "showtitle", "tvshowid", "thumbnail", "file", "fanart", "streamdetails"]}, "id":1}
to read the playlist items properties, even if they're not in the library, but I can't get the Playlist.Add method to set the properties and can't find another method which does it.
{"jsonrpc": "2.0", "method": "Playlist.Add", "params": {"playlistid": 1, "item":{"file":"C:/Users/TV/AppData/Roaming/XBMC/userdata/something.mp4"}}, "id":1}
works to set the playlist item file, but how do you set the other properties?
I'm trying to change the following existing code to the json interface:
u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)
liz=xbmcgui.ListItem(name, iconImage=dir_image, thumbnailImage=iconimage)
liz.setInfo( type="Video", infoLabels={ "Title": name, "Plot": description, "Genre": genre, "Year": date } )
liz.setProperty( "Fanart_Image", fanart )
liz.addContextMenuItems(contextMenu_)
xbmc.PlayList(1).add(u, liz)
How can I accomplish this with the json rpc api? Thanks in advance.