Merge pull request #1249 from croneter/fix-playlist-keyerror

Fix rare KeyError: None when trying to sync playlists
This commit is contained in:
croneter 2020-12-18 15:53:55 +01:00 committed by GitHub
commit 56516d3e1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -357,6 +357,10 @@ def sync_plex_playlist(playlist=None, xml=None, plex_id=None):
if api.playlist_type() == v.PLEX_TYPE_PHOTO_PLAYLIST:
# Not supported by Kodi
return False
elif api.playlist_type() is None:
# Encountered in logs, seems to be a malformed answer
LOG.error('Playlist type is missing: %s', api.xml.attrib)
return False
name = api.title()
typus = v.KODI_PLAYLIST_TYPE_FROM_PLEX[api.playlist_type()]
if (not app.SYNC.enable_music and typus == v.PLEX_PLAYLIST_TYPE_AUDIO):