2018-01-10, 23:19
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:
I'll greatly appreciate if anyone has any idea if it's a bug, a feature or has a fix.
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.