diff --git a/comictalker/comiccacher.py b/comictalker/comiccacher.py index 733a594..80bb49d 100644 --- a/comictalker/comiccacher.py +++ b/comictalker/comiccacher.py @@ -88,6 +88,8 @@ class ComicCacher: + "name TEXT," + "publisher TEXT," + "count_of_issues INT," + + "count_of_volumes INT," + + "volume TEXT," + "start_year INT," + "image_url TEXT," + "aliases TEXT," # Newline separated @@ -152,6 +154,8 @@ class ComicCacher: "name": record.name, "publisher": record.publisher, "count_of_issues": record.count_of_issues, + "count_of_volumes": record.count_of_volumes, + "volume": record.volume, "start_year": record.start_year, "image_url": record.image_url, "description": record.description, @@ -183,11 +187,13 @@ class ComicCacher: name=record[5], publisher=record[6], count_of_issues=record[7], - start_year=record[8], - image_url=record[9], - aliases=record[10].strip().splitlines(), - description=record[11], - genres=record[12].strip().splitlines(), + count_of_volumes=record[8], + volume=record[9], + start_year=record[10], + image_url=record[11], + aliases=record[12].strip().splitlines(), + description=record[13], + genres=record[14].strip().splitlines(), ) results.append(result) @@ -208,6 +214,8 @@ class ComicCacher: "name": series_record.name, "publisher": series_record.publisher, "count_of_issues": series_record.count_of_issues, + "count_of_volumes": series_record.count_of_volumes, + "volume": series_record.volume, "start_year": series_record.start_year, "image_url": series_record.image_url, "description": series_record.description, @@ -281,11 +289,13 @@ class ComicCacher: name=row[1], publisher=row[2], count_of_issues=row[3], - start_year=row[4], - image_url=row[5], - aliases=row[6].strip().splitlines(), - description=row[7], - genres=row[8].strip().splitlines(), + count_of_volumes=row[4], + volume=row[5], + start_year=row[6], + image_url=row[7], + aliases=row[8].strip().splitlines(), + description=row[9], + genres=row[10].strip().splitlines(), ) return result @@ -302,6 +312,8 @@ class ComicCacher: start_year=None, aliases=[], count_of_issues=None, + count_of_volumes=None, + volume=None, ) con = lite.connect(self.db_file) with con: @@ -394,6 +406,8 @@ class ComicCacher: start_year=None, aliases=[], count_of_issues=None, + count_of_volumes=None, + volume=None, ) # now process the results diff --git a/comictalker/resulttypes.py b/comictalker/resulttypes.py index f4156dd..45a38e0 100644 --- a/comictalker/resulttypes.py +++ b/comictalker/resulttypes.py @@ -14,6 +14,8 @@ class Credit: class ComicSeries: aliases: list[str] count_of_issues: int | None + count_of_volumes: int | None + volume: str | None description: str id: str image_url: str diff --git a/comictalker/talker_utils.py b/comictalker/talker_utils.py index 5f4f8fa..19485c2 100644 --- a/comictalker/talker_utils.py +++ b/comictalker/talker_utils.py @@ -35,6 +35,8 @@ def map_comic_issue_to_metadata( metadata.series = utils.xlate(issue_results.series.name) metadata.issue = IssueString(issue_results.issue_number).as_string() + metadata.volume = utils.xlate(issue_results.series.volume, True) + metadata.volume_count = utils.xlate(issue_results.series.count_of_volumes, True) if issue_results.name: metadata.title = utils.xlate(issue_results.name) diff --git a/comictalker/talkers/comicvine.py b/comictalker/talkers/comicvine.py index 56f8f52..3f7d11e 100644 --- a/comictalker/talkers/comicvine.py +++ b/comictalker/talkers/comicvine.py @@ -501,6 +501,8 @@ class ComicVineTalker(ComicTalker): ComicSeries( aliases=aliases.splitlines(), count_of_issues=record.get("count_of_issues", 0), + count_of_volumes=None, + volume=None, description=record.get("description", ""), id=str(record["id"]), image_url=image_url, diff --git a/testing/comicdata.py b/testing/comicdata.py index 5e8d9fa..7698437 100644 --- a/testing/comicdata.py +++ b/testing/comicdata.py @@ -7,6 +7,8 @@ from comicapi import utils search_results = [ comictalker.resulttypes.ComicSeries( count_of_issues=1, + count_of_volumes=1, + volume="1", description="this is a description", id="1", image_url="https://test.org/image/1", @@ -18,6 +20,8 @@ search_results = [ ), comictalker.resulttypes.ComicSeries( count_of_issues=1, + count_of_volumes=1, + volume="1", description="this is a description", id="2", image_url="https://test.org/image/2", diff --git a/testing/comicvine.py b/testing/comicvine.py index ccffd12..44d169b 100644 --- a/testing/comicvine.py +++ b/testing/comicvine.py @@ -172,6 +172,8 @@ comic_issue_result = ComicIssue( name=cv_issue_result["results"]["volume"]["name"], aliases=[], count_of_issues=cv_volume_result["results"]["count_of_issues"], + count_of_volumes=None, + volume=None, description=cv_volume_result["results"]["description"], image_url=cv_volume_result["results"]["image"]["super_url"], publisher=cv_volume_result["results"]["publisher"]["name"],