Merge pull request #1755 from croneter/py3-fix-attributeerror

Fix playback report not working and AttributeError: 'NoneType' object has no attribute 'startswith'
This commit is contained in:
croneter 2021-12-25 21:05:32 +01:00 committed by GitHub
commit 688a15ac28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -322,6 +322,7 @@ class KodiMonitor(xbmc.Monitor):
kodi_type = item.kodi_type kodi_type = item.kodi_type
plex_id = item.plex_id plex_id = item.plex_id
plex_type = item.plex_type plex_type = item.plex_type
path = item.file
if playqueue.id: if playqueue.id:
container_key = '/playQueues/%s' % playqueue.id container_key = '/playQueues/%s' % playqueue.id
else: else:
@ -329,7 +330,7 @@ class KodiMonitor(xbmc.Monitor):
# Mechanik for Plex skip intro feature # Mechanik for Plex skip intro feature
if utils.settings('enableSkipIntro') == 'true': if utils.settings('enableSkipIntro') == 'true':
status['intro_markers'] = item.api.intro_markers() status['intro_markers'] = item.api.intro_markers()
if item.playmethod is None and not path.startswith('plugin://'): if item.playmethod is None and path and not path.startswith('plugin://'):
item.playmethod = v.PLAYBACK_METHOD_DIRECT_PATH item.playmethod = v.PLAYBACK_METHOD_DIRECT_PATH
item.playerid = playerid item.playerid = playerid
# Remember the currently playing item # Remember the currently playing item