Skip to content

Commit

Permalink
Key exception handling improved
Browse files Browse the repository at this point in the history
  • Loading branch information
b-jesch committed Jul 4, 2024
1 parent ae04f9e commit d5e55ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="service.nfo.updater" name="Watchedstate NFO Updater" version="1.0.9+matrix" provider-name="PvD">
<addon id="service.nfo.updater" name="Watchedstate NFO Updater" version="1.0.10+matrix" provider-name="PvD">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
</requires>
Expand Down
7 changes: 3 additions & 4 deletions default.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, *args, **kwargs):
}

def err(self, method, data):
log("Discard: %s" % method)
log("Discard notification %s" % method)

def quit(self, method, data):
log("System.OnQuit received: %s, exiting application" %data)
Expand Down Expand Up @@ -63,8 +63,7 @@ def videolibrary_onupdate(self, method, data):
mediatype = "episodeid"
details = "episodedetails"
else:
log('Could not determine media type: %s' % item['type'], level=xbmc.LOGERROR)
return False
raise KeyError('Video library type \'%s\' not supported' % item['type'])

query = {"method": mediaquery, "params": {mediatype: item['id'], "properties": ["file"]}}
result = jsonrpc(query)
Expand All @@ -73,7 +72,7 @@ def videolibrary_onupdate(self, method, data):
self.update_nfo(result[details], j_data['playcount'], item['type'])

except KeyError as e:
log('Discard update of NFO: %s' % e.args, level=xbmc.LOGERROR)
log('Key error: %s' % e, level=xbmc.LOGWARNING)
return False

@staticmethod
Expand Down

0 comments on commit d5e55ed

Please sign in to comment.