From b727b1288d9dd62bc373ace4dae8e1bd6a641ef8 Mon Sep 17 00:00:00 2001 From: Mizaki Date: Wed, 15 Feb 2023 17:05:14 +0000 Subject: [PATCH] Apply credit datatype to person data from cache --- comictalker/comiccacher.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/comictalker/comiccacher.py b/comictalker/comiccacher.py index bd3ea8c..47855de 100644 --- a/comictalker/comiccacher.py +++ b/comictalker/comiccacher.py @@ -378,7 +378,12 @@ class ComicCacher: ) # now process the results - + credits = [] + try: + for credit in json.loads(row[13]): + credits.append(Credit(**credit)) + except Exception: + logger.exception("credits failed") record = ComicIssue( id=row[1], name=row[2], @@ -392,7 +397,7 @@ class ComicCacher: alt_image_urls=row[10].strip().splitlines(), characters=row[11].strip().splitlines(), locations=row[12].strip().splitlines(), - credits=json.loads(row[13]), + credits=credits, teams=row[14].strip().splitlines(), story_arcs=row[15].strip().splitlines(), complete=bool(row[16]),