Merge pull request #1720 from croneter/py3-fix-widgets

Fix playback report for widget not working if direct paths are used
This commit is contained in:
croneter 2021-11-25 09:28:22 +01:00 committed by GitHub
commit 42df1f2f55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -308,7 +308,7 @@ class KodiMonitor(xbmc.Monitor):
initialize = False
if initialize:
LOG.debug('Need to initialize Plex and PKC playqueue')
if not kodi_id or not kodi_type:
if not kodi_id or not kodi_type or not path:
kodi_id, kodi_type, path = self._json_item(playerid)
plex_id, plex_type = self._get_ids(kodi_id, kodi_type, path)
if not plex_id:

View file

@ -246,9 +246,13 @@ class PlaylistItem(object):
def init_streams(self):
"""
Initializes all streams after Kodi has started playing this video
WARNING: KODI TAKES FOREVER TO INITIALIZE STREAMS AFTER PLAYBACK
STARTUP. YOU WONT GET THE CORRECT NUMBER OFAUDIO AND SUB STREAMS RIGHT
AFTER STARTUP. Seems like you need to wait a couple of seconds
"""
if not app.PLAYSTATE.item == self:
# Already stopped playback or skipped to the next one
LOG.warn('Skipping init_streams!')
return
self.init_kodi_streams()
self.switch_to_plex_stream('video')