From 1121bd3f434bab4f038123e62984e682c44b0bd3 Mon Sep 17 00:00:00 2001 From: gignsky Date: Fri, 20 Jan 2023 22:14:22 -0500 Subject: [PATCH] resolves issue #53 --- logic/logical_functions/plex_logical.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/logic/logical_functions/plex_logical.py b/logic/logical_functions/plex_logical.py index 88c1951..1de1101 100644 --- a/logic/logical_functions/plex_logical.py +++ b/logic/logical_functions/plex_logical.py @@ -2,15 +2,19 @@ def plex_show_tvdb_CHECKER(plex_show): + # TODO NOTE THIS PROBOBLY NEEDS TO BE REFINED INTO ITERATING THROUGH A LOOP SO THAT IF TVDB ID IS NOT IN ONE OF THOSE TWO PLACES IT CAN STILL BE FOUND THIS WILL PRODUCE A PLEX SHOW CANNOT BE FOUND ERROR """Prevents end of index issues with some user accounts containing large histories""" - try: - x = str(plex_show.guids[2].id).replace("tvdb://", "") - # print("Index -- No Error") - return x - except: - x = str(plex_show.guids[1].id).replace("tvdb://", "") - # print("End of Index -- Due to Error") - return x + if plex_show.guids != []: + try: + x = str(plex_show.guids[2].id).replace("tvdb://", "") + # print("Index -- No Error") + except: + x = str(plex_show.guids[1].id).replace("tvdb://", "") + # print("End of Index -- Due to Error") + else: + x = None + + return x def plex_shows_to_check(inprogress_shows):