Posts: 43
Joined: Nov 2013
Is there an easy way to keep track of the played state for remote videos in a Python add-on? I noticed that Frodo keeps track of how far you've gotten in a given video, but I'm not sure if there's a way to query that from Python. It seems like I'd need to do something to figure out if a video is 1) unplayed, 2) in progress, or 3) played before adding the list item for it. Any ideas, or even better, some code from an add-on that already does this?
Posts: 43
Joined: Nov 2013
2013-11-30, 06:01
(This post was last modified: 2013-11-30, 06:10 by User 191275.)
Should this work? I keep getting an "Invalid params." error.
Code:
query = xbmc.executeJSONRPC(simplejson.dumps(
{ "jsonrpc": "2.0",
"method": "Files.GetFileDetails",
"params": {
"file": remote_url, # This is the full URL to a file on the web
"media": "video",
"properties": ["playcount"],
},
"id": 1
}
))
I looked in the videos database and there's an entry for the URL I'm querying.
EDIT: The logs show this, though:
Code:
22:04:09 T:140503211308800 ERROR: GetDirectory - Unable to get http directory
22:04:09 T:140503211308800 ERROR: GetDirectory - Error getting <<remote_url's parent dir>>
Posts: 1,088
Joined: Nov 2012
Reputation:
51
ah REMOTE videos. Didnt see that the first time.
Posts: 43
Joined: Nov 2013
2013-12-01, 02:55
(This post was last modified: 2013-12-01, 03:25 by User 191275.)
It looks like this line might be the issue:
https://github.com/xbmc/xbmc/blob/12.2-F...s.cpp#L212
EDIT: To elaborate, File.GetFileDetails tries to ensure that it can get the parent directory, but that almost never works for files on the web. Is this a bug? It'd be super great if this worked, since then add-ons that play web video could easily show played states. It's disheartening that all the info is in the database, but I can't use JSON-RPC to grab it (and my understanding is that add-ons can't directly query the DB if they want to be allowed in the official repo).
Posts: 43
Joined: Nov 2013
Since this seems like an issue with XBMC, would it make sense to move this to the "Feature Suggestions" forum?