fix add issue
This commit is contained in:
@@ -90,12 +90,21 @@ class DownloadService:
|
||||
self._download_speeds: deque[float] = deque(maxlen=10)
|
||||
|
||||
# Subscribe to SeriesApp download events for progress tracking
|
||||
# Note: Events library uses assignment (=), not += operator
|
||||
if hasattr(anime_service, '_app') and hasattr(
|
||||
anime_service._app, 'download_status'
|
||||
):
|
||||
anime_service._app.download_status += (
|
||||
self._on_seriesapp_download_status
|
||||
)
|
||||
# Save existing handler if any, and chain them
|
||||
existing_handler = anime_service._app.download_status
|
||||
if existing_handler:
|
||||
def chained_handler(args):
|
||||
existing_handler(args)
|
||||
self._on_seriesapp_download_status(args)
|
||||
anime_service._app.download_status = chained_handler
|
||||
else:
|
||||
anime_service._app.download_status = (
|
||||
self._on_seriesapp_download_status
|
||||
)
|
||||
|
||||
# Load persisted queue
|
||||
self._load_queue()
|
||||
|
||||
Reference in New Issue
Block a user