How to set watched status via python code?
#31
Let's put these snippets on a FAQ page for writing plugins. They will be buried here over time with other posts
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#32
(2012-11-06, 01:59)jmarshall Wrote: You have 2 choices:

1. Supply the resume point from your plugin. This overrides XBMC's resume point. You do this by setting totaltime and starttime properties.
2. Let XBMC handle it all.

The second can only be done using playable plugin:// items (i.e. items that XBMC plays back by feeding the plugin:// URL back to your script and you respond by calling setResolvedUrl).

Can you help me understand why I'd use the setResolvedUrl approach vs. using the approach of "xbmcplugin.addDirectoryItem" which I pass the URL in to which will be used for playback (and which I then set infolabels like totaltime, etc for the listitem I pass into addDirectoryItem)? Not sure what the difference is.
Reply
#33
Both use addDirectoryItem. The cases where you'd use setResolvedUrl is when:

1. The URL is time-sensitive (e.g. it'll time-out if not used within X minutes).
2. The URL takes a while to fetch per item (e.g. an additional page fetch).
3. You want to set additional information on the item (art, infolabels etc.) at play time but it takes too long to set them at listing time.

etc.
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
Reply
#34
Another reason for using setResolvedUrl instead of direct exposing the playable-url to xbmc is to avoid xbmc's mime-type checking for each listitem. (Which could also be avoided by adding mime-type explicit via setProperty - but this isn't so nice)
My GitHub. My Add-ons:
Image
Reply

Logout Mark Read Team Forum Stats Members Help
How to set watched status via python code?0