2022-07-11 16:10:31 -07:00
from __future__ import annotations
from typing import Any
import comicapi . genericmetadata
2022-10-19 16:32:40 -07:00
from comicapi import utils
2022-07-11 16:10:31 -07:00
2022-07-13 19:56:34 -07:00
def filter_field_list ( cv_result , kwargs ) :
if " field_list " in kwargs [ " params " ] :
for key in list ( cv_result . keys ( ) ) :
if key not in kwargs [ " params " ] [ " field_list " ] :
del cv_result [ key ]
2022-07-11 16:10:31 -07:00
cv_issue_result : dict [ str , Any ] = {
" error " : " OK " ,
" limit " : 1 ,
" offset " : 0 ,
" number_of_page_results " : 1 ,
" number_of_total_results " : 1 ,
" status_code " : 1 ,
" results " : {
2022-12-22 10:16:32 -08:00
" aliases " : None ,
2022-07-18 09:00:56 -07:00
" api_detail_url " : " https://comicvine.gamespot.com/api/issue/4000-140529/ " ,
2022-07-11 16:10:31 -07:00
" associated_images " : [ ] ,
" character_credits " : [ ] ,
" character_died_in " : [ ] ,
" concept_credits " : [ ] ,
2022-07-18 09:00:56 -07:00
" cover_date " : " 2007-10-01 " ,
" date_added " : " 2008-10-16 05:25:47 " ,
" date_last_updated " : " 2010-06-09 18:05:49 " ,
2022-07-11 16:10:31 -07:00
" deck " : None ,
2022-07-18 09:00:56 -07:00
" description " : " <i>For 12-year-old Anda, getting paid real money to kill the characters of players who were cheating in her favorite online computer game was a win-win situation. Until she found out who was paying her, and what those characters meant to the livelihood of children around the world.</i> " ,
2022-07-11 16:10:31 -07:00
" first_appearance_characters " : None ,
" first_appearance_concepts " : None ,
" first_appearance_locations " : None ,
" first_appearance_objects " : None ,
" first_appearance_storyarcs " : None ,
" first_appearance_teams " : None ,
" has_staff_review " : False ,
2022-07-18 09:00:56 -07:00
" id " : 140529 ,
2022-07-11 16:10:31 -07:00
" image " : {
2022-07-18 09:00:56 -07:00
" icon_url " : " https://comicvine.gamespot.com/a/uploads/square_avatar/0/574/585444-109004_20080707014047_large.jpg " ,
" medium_url " : " https://comicvine.gamespot.com/a/uploads/scale_medium/0/574/585444-109004_20080707014047_large.jpg " ,
" screen_url " : " https://comicvine.gamespot.com/a/uploads/screen_medium/0/574/585444-109004_20080707014047_large.jpg " ,
" screen_large_url " : " https://comicvine.gamespot.com/a/uploads/screen_kubrick/0/574/585444-109004_20080707014047_large.jpg " ,
" small_url " : " https://comicvine.gamespot.com/a/uploads/scale_small/0/574/585444-109004_20080707014047_large.jpg " ,
" super_url " : " https://comicvine.gamespot.com/a/uploads/scale_large/0/574/585444-109004_20080707014047_large.jpg " ,
" thumb_url " : " https://comicvine.gamespot.com/a/uploads/scale_avatar/0/574/585444-109004_20080707014047_large.jpg " ,
" tiny_url " : " https://comicvine.gamespot.com/a/uploads/square_mini/0/574/585444-109004_20080707014047_large.jpg " ,
" original_url " : " https://comicvine.gamespot.com/a/uploads/original/0/574/585444-109004_20080707014047_large.jpg " ,
2022-07-11 16:10:31 -07:00
" image_tags " : " All Images " ,
} ,
2022-07-18 09:00:56 -07:00
" issue_number " : " 1 " ,
2022-07-11 16:10:31 -07:00
" location_credits " : [ ] ,
2022-07-18 09:00:56 -07:00
" name " : " Anda ' s Game " ,
2022-07-11 16:10:31 -07:00
" object_credits " : [ ] ,
" person_credits " : [
{
" api_detail_url " : " https://comicvine.gamespot.com/api/person/4040-56410/ " ,
" id " : 56410 ,
" name " : " Dara Naraghi " ,
" site_detail_url " : " https://comicvine.gamespot.com/dara-naraghi/4040-56410/ " ,
" role " : " writer " ,
} ,
{
2022-07-18 09:00:56 -07:00
" api_detail_url " : " https://comicvine.gamespot.com/api/person/4040-57222/ " ,
" id " : 57222 ,
" name " : " Esteve Polls " ,
" site_detail_url " : " https://comicvine.gamespot.com/esteve-polls/4040-57222/ " ,
2024-02-18 15:52:35 -08:00
" role " : " artist, writer " ,
2022-07-18 09:00:56 -07:00
} ,
{
" api_detail_url " : " https://comicvine.gamespot.com/api/person/4040-48472/ " ,
" id " : 48472 ,
" name " : " Neil Uyetake " ,
" site_detail_url " : " https://comicvine.gamespot.com/neil-uyetake/4040-48472/ " ,
" role " : " letterer " ,
} ,
{
" api_detail_url " : " https://comicvine.gamespot.com/api/person/4040-5329/ " ,
" id " : 5329 ,
" name " : " Sam Kieth " ,
" site_detail_url " : " https://comicvine.gamespot.com/sam-kieth/4040-5329/ " ,
2022-07-11 16:10:31 -07:00
" role " : " cover " ,
} ,
2022-07-18 09:00:56 -07:00
{
" api_detail_url " : " https://comicvine.gamespot.com/api/person/4040-58534/ " ,
" id " : 58534 ,
" name " : " Ted Adams " ,
" site_detail_url " : " https://comicvine.gamespot.com/ted-adams/4040-58534/ " ,
" role " : " editor " ,
} ,
2022-07-11 16:10:31 -07:00
] ,
2022-07-18 09:00:56 -07:00
" site_detail_url " : " https://comicvine.gamespot.com/cory-doctorows-futuristic-tales-of-the-here-and-no/4000-140529/ " ,
2022-07-11 16:10:31 -07:00
" store_date " : None ,
" story_arc_credits " : [ ] ,
" team_credits " : [ ] ,
" team_disbanded_in " : [ ] ,
" volume " : {
" api_detail_url " : " https://comicvine.gamespot.com/api/volume/4050-23437/ " ,
" id " : 23437 ,
" name " : " Cory Doctorow ' s Futuristic Tales of the Here and Now " ,
" site_detail_url " : " https://comicvine.gamespot.com/cory-doctorows-futuristic-tales-of-the-here-and-no/4050-23437/ " ,
} ,
} ,
" version " : " 1.0 " ,
}
cv_volume_result : dict [ str , Any ] = {
" error " : " OK " ,
" limit " : 1 ,
" offset " : 0 ,
" number_of_page_results " : 1 ,
" number_of_total_results " : 1 ,
" status_code " : 1 ,
" results " : {
2022-12-22 10:16:32 -08:00
" aliases " : None ,
2022-07-18 09:00:56 -07:00
" api_detail_url " : " https://comicvine.gamespot.com/api/volume/4050-23437/ " ,
2022-07-11 16:10:31 -07:00
" count_of_issues " : 6 ,
2022-07-18 09:00:56 -07:00
" date_added " : " 2008-10-16 05:25:47 " ,
" date_last_updated " : " 2012-01-18 17:21:57 " ,
" deck " : None ,
" description " : " <p>Writer and <em>BoingBoing.net</em> co-editor <strong>Cory Doctorow</strong> has won acclaim for his science-fiction writing as well as his Creative Commons presentation of his material. Now, IDW Publishing is proud to present six standalone stories adapted from Doctorow ' s work, each featuring cover art by some of comics ' top talents.</p> " ,
2022-07-11 16:10:31 -07:00
" id " : 23437 ,
2022-07-18 09:00:56 -07:00
" image " : {
" icon_url " : " https://comicvine.gamespot.com/a/uploads/square_avatar/0/574/585444-109004_20080707014047_large.jpg " ,
" medium_url " : " https://comicvine.gamespot.com/a/uploads/scale_medium/0/574/585444-109004_20080707014047_large.jpg " ,
" screen_url " : " https://comicvine.gamespot.com/a/uploads/screen_medium/0/574/585444-109004_20080707014047_large.jpg " ,
" screen_large_url " : " https://comicvine.gamespot.com/a/uploads/screen_kubrick/0/574/585444-109004_20080707014047_large.jpg " ,
" small_url " : " https://comicvine.gamespot.com/a/uploads/scale_small/0/574/585444-109004_20080707014047_large.jpg " ,
" super_url " : " https://comicvine.gamespot.com/a/uploads/scale_large/0/574/585444-109004_20080707014047_large.jpg " ,
" thumb_url " : " https://comicvine.gamespot.com/a/uploads/scale_avatar/0/574/585444-109004_20080707014047_large.jpg " ,
" tiny_url " : " https://comicvine.gamespot.com/a/uploads/square_mini/0/574/585444-109004_20080707014047_large.jpg " ,
" original_url " : " https://comicvine.gamespot.com/a/uploads/original/0/574/585444-109004_20080707014047_large.jpg " ,
" image_tags " : " All Images " ,
} ,
2022-07-11 16:10:31 -07:00
" name " : " Cory Doctorow ' s Futuristic Tales of the Here and Now " ,
" publisher " : {
" api_detail_url " : " https://comicvine.gamespot.com/api/publisher/4010-1190/ " ,
" id " : 1190 ,
" name " : " IDW Publishing " ,
} ,
2022-07-18 09:00:56 -07:00
" site_detail_url " : " https://comicvine.gamespot.com/cory-doctorows-futuristic-tales-of-the-here-and-no/4050-23437/ " ,
2022-07-11 16:10:31 -07:00
" start_year " : " 2007 " ,
} ,
" version " : " 1.0 " ,
}
2022-07-13 19:56:34 -07:00
cv_not_found = {
" error " : " Object Not Found " ,
" limit " : 0 ,
" offset " : 0 ,
" number_of_page_results " : 0 ,
" number_of_total_results " : 0 ,
" status_code " : 101 ,
" results " : [ ] ,
}
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
comic_series_result = comicapi . genericmetadata . ComicSeries (
id = str ( cv_issue_result [ " results " ] [ " volume " ] [ " id " ] ) ,
name = cv_issue_result [ " results " ] [ " volume " ] [ " name " ] ,
2023-09-24 06:33:57 -07:00
aliases = set ( ) ,
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
count_of_issues = cv_volume_result [ " results " ] [ " count_of_issues " ] ,
count_of_volumes = None ,
description = cv_volume_result [ " results " ] [ " description " ] ,
image_url = cv_volume_result [ " results " ] [ " image " ] [ " super_url " ] ,
publisher = cv_volume_result [ " results " ] [ " publisher " ] [ " name " ] ,
start_year = int ( cv_volume_result [ " results " ] [ " start_year " ] ) ,
format = None ,
2022-12-21 17:00:59 -08:00
)
2022-10-19 16:32:40 -07:00
date = utils . parse_date_str ( cv_issue_result [ " results " ] [ " cover_date " ] )
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
comic_issue_result = comicapi . genericmetadata . GenericMetadata (
tag_origin = comicapi . genericmetadata . TagOrigin ( " comicvine " , " Comic Vine " ) ,
2023-09-24 06:33:57 -07:00
title_aliases = set ( ) ,
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
month = date [ 1 ] ,
year = date [ 2 ] ,
day = date [ 0 ] ,
description = cv_issue_result [ " results " ] [ " description " ] ,
publisher = cv_volume_result [ " results " ] [ " publisher " ] [ " name " ] ,
issue_count = cv_volume_result [ " results " ] [ " count_of_issues " ] ,
issue_id = str ( cv_issue_result [ " results " ] [ " id " ] ) ,
series = cv_issue_result [ " results " ] [ " volume " ] [ " name " ] ,
series_id = str ( cv_issue_result [ " results " ] [ " volume " ] [ " id " ] ) ,
2023-12-17 15:51:43 -08:00
_cover_image = cv_issue_result [ " results " ] [ " image " ] [ " super_url " ] ,
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
issue = cv_issue_result [ " results " ] [ " issue_number " ] ,
volume = None ,
title = cv_issue_result [ " results " ] [ " name " ] ,
2024-02-17 15:08:36 -08:00
web_links = [ comicapi . genericmetadata . parse_url ( cv_issue_result [ " results " ] [ " site_detail_url " ] ) ] ,
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
)
2022-07-11 16:10:31 -07:00
cv_md = comicapi . genericmetadata . GenericMetadata (
is_empty = False ,
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
tag_origin = comicapi . genericmetadata . TagOrigin ( " comicvine " , " Comic Vine " ) ,
2022-12-23 00:09:19 -08:00
issue_id = str ( cv_issue_result [ " results " ] [ " id " ] ) ,
2022-07-11 16:10:31 -07:00
series = cv_issue_result [ " results " ] [ " volume " ] [ " name " ] ,
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
series_id = str ( cv_issue_result [ " results " ] [ " volume " ] [ " id " ] ) ,
2022-07-11 16:10:31 -07:00
issue = cv_issue_result [ " results " ] [ " issue_number " ] ,
title = cv_issue_result [ " results " ] [ " name " ] ,
publisher = cv_volume_result [ " results " ] [ " publisher " ] [ " name " ] ,
month = date [ 1 ] ,
year = date [ 2 ] ,
day = date [ 0 ] ,
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
issue_count = cv_volume_result [ " results " ] [ " count_of_issues " ] ,
2022-07-11 16:10:31 -07:00
volume = None ,
2023-09-24 06:33:57 -07:00
genres = set ( ) ,
2022-07-11 16:10:31 -07:00
language = None ,
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
description = cv_issue_result [ " results " ] [ " description " ] ,
2022-07-11 16:10:31 -07:00
volume_count = None ,
critical_rating = None ,
country = None ,
alternate_series = None ,
alternate_number = None ,
alternate_count = None ,
imprint = None ,
2022-11-05 09:49:59 -07:00
notes = None ,
2024-02-17 15:08:36 -08:00
web_links = [ comicapi . genericmetadata . parse_url ( cv_issue_result [ " results " ] [ " site_detail_url " ] ) ] ,
2022-07-11 16:10:31 -07:00
format = None ,
manga = None ,
black_and_white = None ,
page_count = None ,
maturity_rating = None ,
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
story_arcs = [ ] ,
series_groups = [ ] ,
2022-07-11 16:10:31 -07:00
scan_info = None ,
2023-09-24 06:33:57 -07:00
characters = set ( ) ,
teams = set ( ) ,
locations = set ( ) ,
2022-07-11 16:10:31 -07:00
credits = [
2024-02-18 15:52:35 -08:00
comicapi . genericmetadata . Credit ( primary = False , person = " Dara Naraghi " , role = " Writer " ) ,
comicapi . genericmetadata . Credit ( primary = False , person = " Esteve Polls " , role = " Artist " ) ,
comicapi . genericmetadata . Credit ( primary = False , person = " Esteve Polls " , role = " Writer " ) ,
comicapi . genericmetadata . Credit ( primary = False , person = " Neil Uyetake " , role = " Letterer " ) ,
comicapi . genericmetadata . Credit ( primary = False , person = " Sam Kieth " , role = " Cover " ) ,
comicapi . genericmetadata . Credit ( primary = False , person = " Ted Adams " , role = " Editor " ) ,
2022-07-11 16:10:31 -07:00
] ,
2022-07-18 09:00:56 -07:00
tags = set ( ) ,
2022-07-11 16:10:31 -07:00
pages = [ ] ,
price = None ,
is_version_of = None ,
rights = None ,
identifier = None ,
last_mark = None ,
2023-12-17 15:51:43 -08:00
_cover_image = cv_issue_result [ " results " ] [ " image " ] [ " super_url " ] ,
2022-07-11 16:10:31 -07:00
)
class MockResponse :
""" Mocks the response object from requests """
2022-07-18 09:00:56 -07:00
def __init__ ( self , result : dict [ str , Any ] , content = None ) - > None :
2022-07-11 16:10:31 -07:00
self . status_code = 200
self . result = result
2022-07-18 09:00:56 -07:00
self . content = content
2022-07-11 16:10:31 -07:00
2023-11-23 15:58:00 -08:00
def json ( self ) - > dict [ str , list [ Any ] ] :
2022-07-11 16:10:31 -07:00
return self . result