diff --git a/booru_viewer/gui/app.py b/booru_viewer/gui/app.py index 4de9ea6..b8480b9 100644 --- a/booru_viewer/gui/app.py +++ b/booru_viewer/gui/app.py @@ -51,30 +51,6 @@ from .settings import SettingsDialog log = logging.getLogger("booru") -class AsyncSignals(QObject): - """Signals for async worker results.""" - search_done = Signal(list) - search_append = Signal(list) - search_error = Signal(str) - thumb_done = Signal(int, str) - image_done = Signal(str, str) - image_error = Signal(str) - # Fast-path for uncached video posts: emit the remote URL directly - # so mpv can start streaming + decoding immediately instead of - # waiting for download_image to write the whole file to disk first. - # download_image still runs in parallel to populate the cache for - # next time. Args: (url, info, width, height) — width/height come - # from post.width/post.height for the popout pre-fit optimization. - video_stream = Signal(str, str, int, int) - bookmark_done = Signal(int, str) - bookmark_error = Signal(str) - autocomplete_done = Signal(list) - batch_progress = Signal(int, int) # current, total - batch_done = Signal(str) - download_progress = Signal(int, int) # bytes_downloaded, total_bytes - prefetch_progress = Signal(int, float) # index, progress (0-1 or -1 to hide) - - # -- Info Panel -- class InfoPanel(QWidget): @@ -3577,3 +3553,4 @@ def run() -> None: # -- Refactor compatibility shims (deleted in commit 14) -- from .search_state import SearchState # re-export for refactor compat from .log_handler import LogHandler # re-export for refactor compat +from .async_signals import AsyncSignals # re-export for refactor compat diff --git a/booru_viewer/gui/async_signals.py b/booru_viewer/gui/async_signals.py new file mode 100644 index 0000000..9ae7920 --- /dev/null +++ b/booru_viewer/gui/async_signals.py @@ -0,0 +1,29 @@ +"""Qt signal hub for async worker results.""" + +from __future__ import annotations + +from PySide6.QtCore import QObject, Signal + + +class AsyncSignals(QObject): + """Signals for async worker results.""" + search_done = Signal(list) + search_append = Signal(list) + search_error = Signal(str) + thumb_done = Signal(int, str) + image_done = Signal(str, str) + image_error = Signal(str) + # Fast-path for uncached video posts: emit the remote URL directly + # so mpv can start streaming + decoding immediately instead of + # waiting for download_image to write the whole file to disk first. + # download_image still runs in parallel to populate the cache for + # next time. Args: (url, info, width, height) — width/height come + # from post.width/post.height for the popout pre-fit optimization. + video_stream = Signal(str, str, int, int) + bookmark_done = Signal(int, str) + bookmark_error = Signal(str) + autocomplete_done = Signal(list) + batch_progress = Signal(int, int) # current, total + batch_done = Signal(str) + download_progress = Signal(int, int) # bytes_downloaded, total_bytes + prefetch_progress = Signal(int, float) # index, progress (0-1 or -1 to hide)