Fix KeyError on non-PKC playback startup
This commit is contained in:
parent
0220c84554
commit
de626f5cd9
1 changed files with 5 additions and 1 deletions
|
@ -312,7 +312,11 @@ class KodiMonitor(xbmc.Monitor):
|
||||||
# element otherwise
|
# element otherwise
|
||||||
self._already_slept = True
|
self._already_slept = True
|
||||||
xbmc.sleep(1000)
|
xbmc.sleep(1000)
|
||||||
json_item = js.get_item(playerid)
|
try:
|
||||||
|
json_item = js.get_item(playerid)
|
||||||
|
except KeyError:
|
||||||
|
LOG.debug('No playing item returned by Kodi')
|
||||||
|
return None, None, None
|
||||||
LOG.debug('Kodi playing item properties: %s', json_item)
|
LOG.debug('Kodi playing item properties: %s', json_item)
|
||||||
return (json_item.get('id'),
|
return (json_item.get('id'),
|
||||||
json_item.get('type'),
|
json_item.get('type'),
|
||||||
|
|
Loading…
Reference in a new issue