Faster lookup of elements in our plex.db

This commit is contained in:
croneter 2019-08-09 15:02:12 +02:00
parent 24ebb38f74
commit 95b469efb5

View file

@ -431,9 +431,10 @@ def playlist_item_from_xml(xml_video_element, kodi_id=None, kodi_type=None):
if kodi_id is not None: if kodi_id is not None:
item.kodi_id = kodi_id item.kodi_id = kodi_id
item.kodi_type = kodi_type item.kodi_type = kodi_type
elif item.plex_id is not None and item.plex_type != v.PLEX_TYPE_CLIP: elif item.plex_type != v.PLEX_TYPE_CLIP:
with PlexDB(lock=False) as plexdb: with PlexDB(lock=False) as plexdb:
db_element = plexdb.item_by_id(item.plex_id) db_element = plexdb.item_by_id(item.plex_id,
plex_type=item.plex_type)
if db_element: if db_element:
item.kodi_id = db_element['kodi_id'] item.kodi_id = db_element['kodi_id']
item.kodi_type = db_element['kodi_type'] item.kodi_type = db_element['kodi_type']