Posts: 646
Joined: May 2009
Reputation:
30
With work done on the metahandlers library, Icefilms and other similar addons we have a need to automatically set a watched flag and store it when a video has been watched
XBMC automatically sets the watched flag on a video item that you watch x% of.. when you navigate to another list and come back the flag is gone, so it's just temporary
Is it possible to detect/grab that watched flag within the addon so that we can then store it?
Posts: 12,706
Joined: Nov 2003
Reputation:
129
spiff
Team-Kodi Member
Posts: 12,706
problem here is deeper than that.
the property is attached to the actual file stream, i.e. the volatile url. it's in the db. you just need to know the original (now invalid) url..
the fix needs to be c++ side. we should store this shit for the plugin:// url, not the stream url.
Posts: 646
Joined: May 2009
Reputation:
30
So if I understand correct.. if you then start to store it for the pluggin:// rather than the url will XBMC then be able to permanently keep the watched history within addons?
This would be very nice.. but would we be able to change that flag to watched/unwatched similar to your local library, or require even more work?
As it is now.. is there no way for an addon to detect when xbmc has flagged a video/url as watched?
Posts: 178
Joined: May 2010
Reputation:
5
xayide
Senior Member
Posts: 178
Interesting as I have a plugin that keeps watched eps/movies in my own sql-db. But as being my own plugin browsing the files and list foldernames I have/not watched, I am limited to my own gui where as being able to use library mode would have been so much more fun.
Posts: 24
Joined: May 2011
Reputation:
2
What we ended up doing (because I couldn't find a better way) was create my own player class based on xbmc's player and monitor the total time of the video and current time. When the video is stopped (onplaybackstopped, onplaybackended) just check the percent watched and set a value in the addon db. Then each time we go to display that video we check the db for watched == 7 and set the watched overlay.
it's not a very pretty way of doing it, but it works...
Posts: 646
Joined: May 2009
Reputation:
30
I'm noticing in the last couple Eden beta's (or even further back) that the watched flag is now showing up in addons and remaining
Huge thanks to whoever committed that change!
Is it possible to now add to the standard context menu options to mark as watched/unwatched for video items?
Posts: 26,215
Joined: Oct 2003
Reputation:
187
Pretty sure it was added ages ago. Basically it works for cases where you use setResolvedUrl() (as we assume the URL you give us originally is non-volatile).