From 618e15600f8bcb98695a8bed2722623f4051fb7a Mon Sep 17 00:00:00 2001 From: Timmy Welch Date: Sat, 29 Oct 2022 19:21:11 -0700 Subject: [PATCH] Fix retrieving issues from cache when volume is incomplete --- comictaggerlib/comiccacher.py | 2 ++ comictaggerlib/comicvinetalker.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/comictaggerlib/comiccacher.py b/comictaggerlib/comiccacher.py index 8bd5c82..a501122 100644 --- a/comictaggerlib/comiccacher.py +++ b/comictaggerlib/comiccacher.py @@ -450,6 +450,8 @@ class ComicCacher: set_slots = "" for key in data: + if data[key] is None: + continue if keys != "": keys += ", " diff --git a/comictaggerlib/comicvinetalker.py b/comictaggerlib/comicvinetalker.py index e0daaf8..5b56b14 100644 --- a/comictaggerlib/comicvinetalker.py +++ b/comictaggerlib/comicvinetalker.py @@ -327,10 +327,11 @@ class ComicVineTalker: def fetch_issues_by_volume(self, series_id: int) -> list[resulttypes.CVIssuesResults]: # before we search online, look in our cache, since we might already have this info + volume_data = self.fetch_volume_data(series_id) cvc = ComicCacher() cached_volume_issues_result = cvc.get_volume_issues_info(series_id, self.source_name) - if cached_volume_issues_result: + if len(cached_volume_issues_result) >= volume_data["count_of_issues"]: return cached_volume_issues_result params = {