Kodi Community Forum
v17 'Mark as watched' not working when used on items not belonging to current addon - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: v17 'Mark as watched' not working when used on items not belonging to current addon (/showthread.php?tid=326898)



'Mark as watched' not working when used on items not belonging to current addon - alibabouin - 2018-01-10

Hello,

I stumbled upon a problem while writing an addon that list items from other addons.
It seems 'Mark as Watched' is not working properly when listing items from another plugin.
I must use ListItem.setInfo('video', {'mediatype': 'video'}) to make 'Mark as Watched' appears in the context menu and it still doesn't do anything when selected (nothing is marked).

Here is some code showing the behavior:

python:

# Kodi Version: 17.6
# Code from an addon named 'plugin.video.thisplugin'
xbmcplugin.setContent(int(sys.argv[1]), 'videos')

# This item CAN be marked as watched
list_item = xbmcgui.ListItem(label='Good')
list_item.setInfo('video', {'mediatype': 'video'})
list_item.setProperty('isPlayable', 'true')
# Path from same plugin
xbmcplugin.addDirectoryItem(int(sys.argv[1]), 'plugin://plugin.video.thisplugin/good', list_item, isFolder=False)

# This item CAN'T be marked as watched
list_item = xbmcgui.ListItem(label='Bad')
# Ensure that Kodi knows that this item is a video
list_item.setInfo('video', {'mediatype': 'video'})
list_item.setProperty('isPlayable', 'True')
# Path from another plugin
xbmcplugin.addDirectoryItem(int(sys.argv[1]), 'plugin://plugin.video.anotherplugin/bad', list_item, isFolder=False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))

I'll greatly appreciate if anyone has any idea if it's a bug, a feature or has a fix.