Getting "hide watched" flag and responding to updates
#1
I'm developing a video addon and need to know the status of the "hide watched" setting. I use setResolvedUrl for media files and Kodi handles their watched status fine, but I also want to hide virtual folders if they contain no unwatched files. I have found

Code:
xbmc.getCondVisibility('System.Setting(hidewatched)')

but it doesn't work on the current plugin directory, so for example it will get the hide watched state for "addons" when I'm providing the top-level directory of my addon, rather than "tvshows". I don't see another way to fetch this and have locally implemented

Code:
xbmcplugin.getHideWatched(handle [,content])

but wanted to check for other ways to get this value before sending a pull request.

A related issue is that when the hide watched flag is changed, it doesn't refresh the contents of the plugin directory. I have a local change for that, too, that does a refresh if the flag is changed when viewing a plugin directory, but wanted to again verify first I wasn't missing some other notification or way to set my plugin to be refreshed when this changes.
Reply
#2
First set the plugin content xbmcplugin.setContent, then set the playcount info label on the directory list item itself. I've checked and it hides watched folders correctly.
Reply
#3
(2015-02-28, 13:25)takoi Wrote: First set the plugin content xbmcplugin.setContent, then set the playcount info label on the directory list item itself. I've checked and it hides watched folders correctly.

I do set the content already. Thanks for the pointer to setInfo/playcount. Do you know if there's a way (besides looking at the database directly) for my plugin to determine the watched status for contained video items, i.e., enumerate the directory contents so I can set the flag correctly on the directory itself? Specifically, given a plugin URL, I'd need to be able to get a play count.

InfoTagVideo has a getPlayCount method, but the only way I can see to get such an object is through Player.getVideoInfoTag, and I want to get information for a media file that is not currently playing.
Reply

Logout Mark Read Team Forum Stats Members Help
Getting "hide watched" flag and responding to updates0