Fix KeyError: u'game' if Plex Arcade has been activated

This commit is contained in:
croneter 2021-02-07 13:00:58 +01:00
parent b9f1aefdc3
commit 63d7732021
2 changed files with 9 additions and 0 deletions

View File

@ -647,6 +647,9 @@ def _sync_from_pms(pick_libraries):
sections = []
old_sections = []
for i, xml_element in enumerate(xml.findall('Directory')):
api = API(xml_element)
if api.plex_type in v.UNSUPPORTED_PLEX_TYPES:
continue
sections.append(Section(index=i, xml_element=xml_element))
with PlexDB() as plexdb:
for section_db in plexdb.all_sections():

View File

@ -161,9 +161,15 @@ PLEX_TYPE_PHOTO = 'photo'
PLEX_TYPE_PLAYLIST = 'playlist'
PLEX_TYPE_CHANNEL = 'channel'
PLEX_TYPE_GAME = 'game'
# E.g. PMS answer when hitting the PMS endpoint /hubs/search
PLEX_TYPE_TAG = 'tag'
# PlexKodiConnect does not support all (content) types
# e.g. Plex Arcade games
UNSUPPORTED_PLEX_TYPES = (PLEX_TYPE_GAME, )
# Used for /:/timeline XML messages
PLEX_PLAYLIST_TYPE_VIDEO = 'video'
PLEX_PLAYLIST_TYPE_AUDIO = 'music'