VideoLibrary.OnUpdate doesn't fire when video mark watched
#1
I've written an addon that pulls media files from the library (i.e. the media is in XBMC's database). I create a directory of these media files by calling:

PHP Code:
xbmcplugin.setContent(pluginhandle"episodes")
xbmcplugin.addDirectoryItem(pluginhandleurl=episode['file'], listitem=liisFolder=False)
xbmcplugin.endOfDirectory(pluginhandle

The problem I'm having is when the user hits "w" and marks the media as watched. In fact it seems to work - the playcount is set, the appropriate overlays are displayed/removed indicating watched etc. Also if I use the native TV Show menu item it will show the episodes are correctly marked as either watched or unwatched.

The part that is broken is that the JSON notification "OnUpdate" doesn't fire. From the native player I this fires:

PHP Code:
{"jsonrpc":"2.0","method":"VideoLibrary.OnUpdate","params":{"data":{"item":{"id":4,"type":"episode"},"playcount":1},"sender":"xbmc"}} 

Why doesn't it fire when the same action marks the media watched/unwatched with "w" in the addon?

My second question - if this is intended behavior, is there a way to catch this event a different way in my addon?

Thanks,

Damon
Reply
#2
It was something that was added in Gotham. Are you testing on Frodo?
Reply
#3
Sorry I should have mentioned that - I'm using 13.1
Reply
#4
I use onNotification to pick up those changes.

Code:
    def onNotification(self, sender, method, data):
        #this only works for GOTHAM
        try:
            self.ndata = ast.literal_eval(data)
        except:
            skip = True

        if method == 'VideoLibrary.OnUpdate':
                       blah

But you are saying that the notification isnt being sent? Right?
Reply
#5
That's right - it isn't being sent. I have a telnet open to the JSON port (9090) too, and I see the update fire from the native "TV Show" or "Movie", but it doesn't fire when "w" is pressed in the addon (even though the library is being updated with the correct value for playcount)

Edit: This is the code I use - very similar:

PHP Code:
def onNotification(selfsendermethoddata):
        if (
method == 'VideoLibrary.OnUpdate'):
            
response json.loads(data)          
            if (
response.has_key('item') and response['item'].has_key('type') and response.get('item').get('type') == 'episode'): # Episode means it is a TV show
                
episodeid response.get('item').get('id')
                
playcount response.get('playcount')
                if (
playcount 0): # If it has been watched 
Reply

Logout Mark Read Team Forum Stats Members Help
VideoLibrary.OnUpdate doesn't fire when video mark watched0