Fix KeyError on playback start
This commit is contained in:
parent
287b888b6f
commit
e6520ad2e8
1 changed files with 7 additions and 0 deletions
|
@ -322,6 +322,13 @@ class KodiMonitor(Monitor):
|
|||
LOG.info('Aborting playback report - item invalid for updates %s',
|
||||
data)
|
||||
return
|
||||
if playerid == -1:
|
||||
# Kodi might return -1 for "last player"
|
||||
try:
|
||||
playerid = js.get_player_ids()[0]
|
||||
except IndexError:
|
||||
LOG.error('Could not retreive active player - aborting')
|
||||
return
|
||||
# Remember that this player has been active
|
||||
state.ACTIVE_PLAYERS.append(playerid)
|
||||
playqueue = PQ.PLAYQUEUES[playerid]
|
||||
|
|
Loading…
Reference in a new issue