JSON-RPC Questions
#1
Hey everybody,

I have some specific questions regarding the json rpc calls.

1. Is it possible to only get watched? For example via VideoLibrary.GetEpisodes or VideoLibrary.GetEpisodesDetails

2. Is there a recommendation how to add other ids? Would like to add trakt and tmdb ids to every movie/episode if that is possible.

3. is there a way to set the progress of an movie or episode via jsonrpc? so that the user is questioned if he wants to resume at XX:XX when he tries to restart the movie?

4. If I got plays does this always mean I have a watched_at and vice versa?

Thanks
Reply
#2
Something like this should work to only get watched episodes:

Code:
import json
import xbmc

request = {"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": { "filter": {"field": "playcount", "operator": "greaterthan", "value": "0"}, "limits": { "start" : 0 }, "properties": ["playcount"], "sort": { "order": "ascending", "method": "label" } }, "id": "libTvShows"}
results = json.loads(xbmc.executeJSONRPC(json.dumps(request)))

You may want to refer to this thread about setting the progress of an item via jsonrpc.
Reply
#3
(2015-02-13, 20:55)curti Wrote: Something like this should work to only get watched episodes:

Code:
import json
import xbmc

request = {"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": { "filter": {"field": "playcount", "operator": "greaterthan", "value": "0"}, "limits": { "start" : 0 }, "properties": ["playcount"], "sort": { "order": "ascending", "method": "label" } }, "id": "libTvShows"}
results = json.loads(xbmc.executeJSONRPC(json.dumps(request)))

You may want to refer to this thread about setting the progress of an item via jsonrpc.

Thank you wasn't aware of the filter, this will shave of even more lines of my script! Smile
Reply
#4
Would be nice to get some info on 2 and 4, anyone?
Reply
#5
It does seem like runtime on episode and movie not holds the real length of the movie but the scrapped one? Is that correct? (not really sure but thats what I would guess)
Is there a way to get all real lengths? There are numerous episodes in my collection which have a runtime of 0.

edit: it seems like movies are okay, but still having this on episodes, and for some reason streamdetails is also empty every time on GetEpisodes
Reply
#6
It's there a way to know if a show is using absolute/dvd /air order?
Seems like 'episode' on getEpisodeDetails can be each of this three? There is probably no way to get one of those explicitly?
Reply

Logout Mark Read Team Forum Stats Members Help
JSON-RPC Questions0