diff --git a/core/downloads/monitor.py b/core/downloads/monitor.py index b28200e9..d08843a4 100644 --- a/core/downloads/monitor.py +++ b/core/downloads/monitor.py @@ -277,18 +277,18 @@ class WebUIDownloadMonitor: except Exception: pass for download in all_downloads: - key = _make_context_key(download.username, download.filename) - # Convert DownloadStatus to transfer dict format for monitor compatibility - live_transfers[key] = { - 'id': download.id, - 'filename': download.filename, - 'username': download.username, - 'state': download.state, - 'percentComplete': download.progress, - 'size': download.size, - 'bytesTransferred': download.transferred, - 'averageSpeed': download.speed, - } + key = _make_context_key(download.username, download.filename) + # Convert DownloadStatus to transfer dict format for monitor compatibility + live_transfers[key] = { + 'id': download.id, + 'filename': download.filename, + 'username': download.username, + 'state': download.state, + 'percentComplete': download.progress, + 'size': download.size, + 'bytesTransferred': download.transferred, + 'averageSpeed': download.speed, + } except Exception as yt_error: logger.error(f"Monitor: Could not fetch streaming source downloads: {yt_error}") diff --git a/services/sync_service.py b/services/sync_service.py index c4331a81..71a3cd35 100644 --- a/services/sync_service.py +++ b/services/sync_service.py @@ -7,7 +7,7 @@ from core.spotify_client import SpotifyClient, Playlist as SpotifyPlaylist, Trac from core.plex_client import PlexClient, PlexTrackInfo from core.jellyfin_client import JellyfinClient from core.navidrome_client import NavidromeClient -from core.soulseek_client import SoulseekClient +from core.download_orchestrator import DownloadOrchestrator from core.matching_engine import MusicMatchingEngine, MatchResult logger = get_logger("sync_service") @@ -44,7 +44,7 @@ class SyncProgress: failed_tracks: int = 0 class PlaylistSyncService: - def __init__(self, spotify_client: SpotifyClient, plex_client: PlexClient, download_orchestrator: SoulseekClient, jellyfin_client: JellyfinClient = None, navidrome_client = None): + def __init__(self, spotify_client: SpotifyClient, plex_client: PlexClient, download_orchestrator: DownloadOrchestrator, jellyfin_client: JellyfinClient = None, navidrome_client = None): self.spotify_client = spotify_client self.plex_client = plex_client self.jellyfin_client = jellyfin_client diff --git a/tests/test_qobuz_credential_sync.py b/tests/test_qobuz_credential_sync.py index 156db419..4432b28e 100644 --- a/tests/test_qobuz_credential_sync.py +++ b/tests/test_qobuz_credential_sync.py @@ -6,7 +6,7 @@ Settings showed "Connected: (Active)" but underneath an error yellow even after a successful login. Root cause: SoulSync runs two QobuzClient instances side by side — one -through ``soulseek_client.client('qobuz')`` for the auth-flow endpoints, and a +through ``download_orchestrator.client('qobuz')`` for the auth-flow endpoints, and a second owned by the enrichment worker thread for thread safety. Login only updated the first instance's in-memory state. The dashboard's "configured" check (and the connection-test step) read the worker