plex: guids

Signed-off-by: Luigi311 <git@luigi311.com>
This commit is contained in:
Luigi311
2024-01-12 17:55:28 -07:00
parent fa533ff65e
commit 362d54b471

View File

@@ -231,9 +231,9 @@ def find_video(plex_search, video_ids, videos=None):
if videos:
for show, seasons in videos.items():
show = {k: v for k, v in show}
if guid_source in show["ids"].keys():
if guid_id in show["ids"][guid_source]:
for season in seasons:
if guid_source in show.keys():
if guid_id == show[guid_source]:
for season in seasons.values():
for episode in season:
episode_videos.append(episode)
@@ -241,8 +241,6 @@ def find_video(plex_search, video_ids, videos=None):
return False, []
except Exception:
logger(f"Plex: failed to find library item for {video_ids['title']}", 2)
logger(traceback.format_exc(), 2)
return False, []
@@ -272,14 +270,12 @@ def get_video_status(plex_search, video_ids, videos):
if guid_source in video_ids.keys():
if guid_id in video_ids[guid_source]:
for video in videos:
if guid_source in video["ids"].keys():
if guid_id in video["ids"][guid_source]:
if guid_source in video.keys():
if guid_id == video[guid_source]:
return video["status"]
return None
except Exception:
logger(f"Plex: failed to find library item for {video_ids['title']}", 2)
logger(traceback.format_exc(), 2)
return None