Skip to content

Commit

Permalink
Merge pull request #58 from gignsky/53-bug-index-out-of-range
Browse files Browse the repository at this point in the history
resolves issue #53 - creates possible new bug ref issue #59
  • Loading branch information
gignsky authored Jan 21, 2023
2 parents 317f294 + 1121bd3 commit 93ae3cf
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions logic/logical_functions/plex_logical.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 93ae3cf

Please sign in to comment.