From aa5fbf7fd13ac0f5fccf15d7dde655ad63bbcfc5 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Sun, 26 Dec 2021 22:49:48 -0500 Subject: [PATCH] fix for cached episode IDs --- modules/cache.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/cache.py b/modules/cache.py index 263b84ab..b5fd7067 100644 --- a/modules/cache.py +++ b/modules/cache.py @@ -202,10 +202,13 @@ class Cache: if row and row[to_id]: datetime_object = datetime.strptime(row["expiration_date"], "%Y-%m-%d") time_between_insertion = datetime.now() - datetime_object - try: - id_to_return = int(row[to_id]) - except ValueError: + if "_" in row[to_id]: id_to_return = row[to_id] + else: + try: + id_to_return = int(row[to_id]) + except ValueError: + id_to_return = row[to_id] expired = time_between_insertion.days > self.expiration out_type = row["media_type"] if return_type else None if return_type: