JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC

  Thread Rating:
  • 7 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
spike411 Offline
Junior Member
Posts: 12
Joined: Apr 2011
Reputation: 0
Location: Prague, Czechia
Post: #1711
Thanks, Montellese, my search-fu was weak today. The proposed solution seems OK.
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,117
Joined: Nov 2011
Reputation: 21
Location: Nantes - France
Post: #1712
Hello.

I want to filter partially watched movies (movies started to watched but not finished) in playlist so I use :
Code:
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "%s", "media": "video", "properties": ["year", "runtime", "file", "playcount", "rating", "plot", "fanart", "thumbnail", "resume", "trailer"]}, "id": 1}' %(_playlist))
But every movie have the following resume property :
Code:
u'resume': {u'position': 0, u'total': 0}
I have started a movie, fast forwarded it and then stoped it.
When I click to view it, XBMC ask me if I want to watch it from start or from 21:12

So where can I found the information "this movie have been watched for 1272 seconds" ?

Thanks.

Sorry for my english, but, you know, I'm French so ...

(This post was last modified: 2012-02-15 21:18 by mikebzh44.)
find quote
Montellese Online
Team-XBMC Developer
Posts: 2,831
Joined: Jan 2009
Reputation: 20
Location: Switzerland
Post: #1713
It should be in the "resume" property. I just tested it with one of my movies and this is what I get from VideoLibrary.GetMovies, VideoLibrary.GetMovieDetails and Files.GetDirectory:
Code:
"resume": { "position": 1849.088134765625, "total": 5024 }
I haven't tested it with smartplaylists though.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,117
Joined: Nov 2011
Reputation: 21
Location: Nantes - France
Post: #1714
Montellese Wrote:It should be in the "resume" property. I just tested it with one of my movies and this is what I get from VideoLibrary.GetMovies, VideoLibrary.GetMovieDetails and Files.GetDirectory:
Code:
"resume": { "position": 1849.088134765625, "total": 5024 }
I haven't tested it with smartplaylists though.

I think that is a bug Sad

Request made by GetDirectory on a playlist :
Code:
{u'rating': 3.7999999523162842,
u'fanart': u'special://masterprofile/Thumbnails/Video/Fanart/d9db9c4e.tbn',
u'filetype': u'file',
[b]u'resume': {u'position': 0, u'total': 0},[/b]
u'label': u'Drive',
u'thumbnail': u'special://masterprofile/Thumbnails/Video/d/d9db9c4e.tbn',
u'file': u'C:\\Vid\xe9os\\Films\\Drive\\Drive.mkv',
u'year': 2011,
u'playcount': 0,
u'runtime': u'100',
u'type': u'movie',
u'id': 192,
u'trailer': u'http://hd.fr.mediaplayer.allocine.fr/nmedia/18/83/93/95/19243476_fa1_vf_sd_001.flv'
}
Request made by GetMovieDetails on the specific movie :
Code:
{u'moviedetails': {[b]u'resume': {u'position': 1271.79809570312[/b]5, u'total': 6024},
u'movieid': 192,
u'label': u'Drive'}}})

Sorry for my english, but, you know, I'm French so ...

find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,564
Joined: Oct 2003
Reputation: 138
Post: #1715
The resume point is returned only if needsCast is set true in GetDetailsForMovie() et. al.

@Montellese: perhaps the additional info isn't being fetched for this field?

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
Montellese Online
Team-XBMC Developer
Posts: 2,831
Joined: Jan 2009
Reputation: 20
Location: Switzerland
Post: #1716
Yeah it probably isn't fetched for smartplaylists but I'm not sure if I want to fix that. The problem with retrieving the extra info ("resume", "sets", "cast" etc) is that the time it takes to retrieve the information skyrockets. This is ok for GetMovieDetails because you only retrieve one movie and it's information. It is also acceptable for VideoLibrary.GetMovies because I can first check whether we actually need to retrieve the extra info and if not I don't set the needsCast flag in the request to the database. But I don't have this kind of information when retrieving smartplaylists (which is done in XBMC's VFS) so enabling that flag by default will slow down loading every smartplaylist independent of whether this happens through JSON-RPC or the XBMC GUI. So it kind of is a bug but only because it would worsen the smartplaylist experience overall.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]
find quote
bthusby Offline
Senior Member
Posts: 133
Joined: Feb 2011
Reputation: 1
Location: Norway
Post: #1717
Is JSON-RPC inherently a bit slow/heavy (bottleneck) when you have a large library of TV Shows?

I was given this explanation in another thread concerning the "On-deck" -feature, a script that shows which episodes I should watch based on what show I'm normally watching, and which is the next unwatched episode in those TV shows.

The script seems to have some performance issues / delay on the ATV2. I also use a MySQL DB on a NAS for my libraries.

BT :)
(This post was last modified: 2012-02-16 16:57 by bthusby.)
find quote
Martijn Offline
Team-XBMC
Posts: 7,787
Joined: Jul 2011
Reputation: 115
Location: Dawn of time
Post: #1718
bthusby Wrote:It seems to have some performance issues on the ATV2.

An ATV2 just hasn't got much ponies. If you want power better buy somethnig better

Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first


For your mediacenter artwork go to
[Image: fanarttv.png]
find quote
Montellese Online
Team-XBMC Developer
Posts: 2,831
Joined: Jan 2009
Reputation: 20
Location: Switzerland
Post: #1719
Obviously the larger your library is the longer it takes to retrieve all the tvshows in it. Furthermore the watchlist script first retrieves all the tvshows and then for every tvshow it retrieves all the episodes. So the more tvshows you have the more it has to go through. And the more episodes there are in every show the longer it takes to process every show. You can't expect it to take the same time to go through all episodes of 10 tvshows compared to all episodes of 50 tvshows.

Furthermore the ATV2 isn't really popular for being very fast or having enough power to do everything XBMC offers. If you don't want to spend more money on your htpc you'll have to live with the fact that it won't be able to do everything as fast as if you spent more money on something faster/better.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]
find quote
bthusby Offline
Senior Member
Posts: 133
Joined: Feb 2011
Reputation: 1
Location: Norway
Post: #1720
Wow, that is impressive response time from the XBMC team Smile

I have a Win 7 PC work horse with XBMC installed, sitting in the next room, but I like the ATV2 due to its simplicity. I don't have to turn on anything and wait for boot-up, and be nagged by updates from Acrobat, Sun and Itunes every other week... Wink

Maybe it is possible to optimize the JSON parsing by not go through the whole library each time? This obviously concerns the implementation of the script and not JSON-RPC as such.

Is JSON-RPC implemented in XBMC using Python?
And if so, is it simplejson which is used in Python, or the allegdely faster python-cjson or ultrajson? I'm unfortunately not an expert.


A lot of people use ATV2, Ipad etc these days for XBMC, and I hope performance and efficiency will be addressed where it can Smile

BT :)
(This post was last modified: 2012-02-16 17:23 by bthusby.)
find quote
Post Reply