Address Copilot review nits
Three small follow-ups from the Copilot review of the rename PR: - services/sync_service.py: PlaylistSyncService.__init__'s download_orchestrator parameter was annotated as SoulseekClient, which was misleading (the object passed is the DownloadOrchestrator with .search_and_download_best, .download, etc — not a SoulseekClient). Switched the import + annotation to DownloadOrchestrator so type checking + IDE help match reality. - tests/test_qobuz_credential_sync.py: docstring still referenced the old soulseek_client global handle; updated to download_orchestrator to match the rest of the codebase. - core/downloads/monitor.py: the `for download in all_downloads` body was over-indented (8 spaces past the for instead of 4) — purely cosmetic but easy to mis-edit. Re-indented to one level.
This commit is contained in:
parent
da424d4bf6
commit
ea04cd5879
3 changed files with 15 additions and 15 deletions
|
|
@ -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}")
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ Settings showed "Connected: <username> (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
|
||||
|
|
|
|||
Loading…
Reference in a new issue