2015-05-13, 06:15
Recently in one of my add-ons, I switched from setting a video stream's URL directly on the ListItem to doing it indirectly via setResolvedUrl. However, I noticed that when I made the change, I can no longer manually mark a video as watched or unwatched from the context menu. I suppose I could implement this myself, but I'm not sure how. Has anyone done something similar?
For reference, here's the relevant code I'm using to create the ListItem:
For reference, here's the relevant code I'm using to create the ListItem:
Code:
# Initially...
url = <some URL back to my plugin>
li = xbmcgui.ListItem(name, iconImage='DefaultVideo.png',
thumbnailImage=thumb)
li.setProperty('IsPlayable', 'true')
xbmcplugin.addDirectoryItem(handle=addon_id, url=url,
listitem=li)
# Later...
video_url = <fetch the real URL>
li = xbmcgui.ListItem(path=video_url)
xbmcplugin.setResolvedUrl(addon_id, True, li)