diff --git a/comictaggerlib/coverimagewidget.py b/comictaggerlib/coverimagewidget.py index 234f42e..703dbaa 100644 --- a/comictaggerlib/coverimagewidget.py +++ b/comictaggerlib/coverimagewidget.py @@ -24,7 +24,6 @@ from typing import Callable from PyQt5 import QtCore, QtGui, QtWidgets, uic -import comictalker.comictalkerapi as ct_api from comicapi import utils from comicapi.comicarchive import ComicArchive from comictaggerlib.imagefetcher import ImageFetcher @@ -184,8 +183,7 @@ class CoverImageWidget(QtWidgets.QWidget): self.update_content() self.issue_id = issue_id - ct_api.url_fetch_complete = self.sig.emit_url - ct_api.url_fetch_complete(image_url, None) + self.sig.emit_url(image_url, None) def set_image_data(self, image_data: bytes) -> None: if self.mode == CoverImageWidget.DataMode: @@ -215,9 +213,11 @@ class CoverImageWidget(QtWidgets.QWidget): # now we need to get the list of alt cover URLs self.label.setText("Searching for alt. covers...") - # page URL should already be cached, so no need to defer - ct_api.alt_url_list_fetch_complete = self.sig.emit_list - self.talker_api.fetch_alternate_cover_urls(utils.xlate(self.issue_id)) + url_list = self.talker_api.fetch_alternate_cover_urls(utils.xlate(self.issue_id)) + if url_list: + self.url_list.extend(url_list) + self.imageCount = len(self.url_list) + self.update_controls() def alt_cover_url_list_fetch_complete(self, url_list: list[str]) -> None: if url_list: diff --git a/comictalker/comictalkerapi.py b/comictalker/comictalkerapi.py index 885fc9a..04614fc 100644 --- a/comictalker/comictalkerapi.py +++ b/comictalker/comictalkerapi.py @@ -18,24 +18,11 @@ from __future__ import annotations import logging import comictalker.talkers.comicvine -from comictalker.talkerbase import ComicTalker, TalkerError # renamed TalkerBase to ComicTalker +from comictalker.talkerbase import ComicTalker, TalkerError logger = logging.getLogger(__name__) -# To signal image loaded etc. TODO Won't be needed hopefully with new async loading -def list_fetch_complete(url_list: list[str]) -> None: - ... - - -def url_fetch_complete(image_url: str, thumb_url: str | None) -> None: - ... - - -alt_url_list_fetch_complete = list_fetch_complete -url_fetch_complete = url_fetch_complete - - def get_comic_talker(source_name: str) -> type[ComicTalker]: # Retrieve the available sources modules sources = get_talkers() diff --git a/comictalker/talkers/comicvine.py b/comictalker/talkers/comicvine.py index 47d477d..157116e 100644 --- a/comictalker/talkers/comicvine.py +++ b/comictalker/talkers/comicvine.py @@ -27,7 +27,6 @@ import requests from bs4 import BeautifulSoup from typing_extensions import Required, TypedDict -import comictalker.comictalkerapi as ct_api from comicapi import utils from comicapi.genericmetadata import GenericMetadata from comicapi.issuestring import IssueString @@ -983,8 +982,6 @@ class ComicVineTalker(ComicTalker): url_list = [x for x in formatted_volume_issues_result[0]["alt_images_url"].split(",") if x] - ct_api.alt_url_list_fetch_complete(url_list) - # CLI expects a list returned return url_list def repair_urls(self, issue_list: list[CVIssueDetailResults]) -> None: