Skip to content

Commit

Permalink
GenericMetadata covers var name changes in CT. Fixes #5
Browse files Browse the repository at this point in the history
  • Loading branch information
mizaki committed Dec 20, 2023
1 parent 97daa5f commit f28214c
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions gcd_talker/gcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,13 +496,17 @@ def _find_issue_images(self, issue_id: int) -> tuple[str, list[str]]:

img_list = covers_page.findAll("img", "cover_img")

for i, image in enumerate(img_list):
# Strip arbitrary number from end for cache
src = image.get("src").split("?")[0]
if i == 0:
cover = src
else:
variants.append(src)
if len(img_list) > 0:
for i, image in enumerate(img_list):
# Strip arbitrary number from end for cache
src = image.get("src").split("?")[0]
if i == 0:
cover = src
else:
variants.append(src)
else:
# TODO check for cloudflare activation and log
logger.debug(f"No image found for ID: {issue_id}")

return cover, variants

Expand Down Expand Up @@ -829,8 +833,8 @@ def _map_comic_issue_to_metadata(self, issue: GCDIssue, series: GCDSeries) -> Ge
series=utils.xlate(series["name"]),
)

md.cover_image = issue.get("image")
md.alternate_images = issue.get("alt_image_urls")
md._cover_image = issue.get("image")
md._alternate_images = issue.get("alt_image_urls")

if issue.get("characters"):
# Logan [disambiguation: Wolverine] - (name) James Howlett
Expand Down

0 comments on commit f28214c

Please sign in to comment.