Keeping track of played state?
#1
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?
Reply
#2
You need to familiarize yourself with the XBMC databases.

http://wiki.xbmc.org/index.php?title=XBM...BMC_Python
Reply
#3
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>>
Reply
#4
ah REMOTE videos. Didnt see that the first time.
Reply
#5
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).
Reply
#6
Since this seems like an issue with XBMC, would it make sense to move this to the "Feature Suggestions" forum?
Reply

Logout Mark Read Team Forum Stats Members Help
Keeping track of played state?0