soulsync/tests/downloads
Broque Thomas 4b4076b57f F: Engine owns hybrid fallback chain
`engine.search_with_fallback(query, source_chain, ...)` walks the
chain in order, skips unconfigured / unregistered plugins,
swallows per-source exceptions, and returns the first non-empty
(tracks, albums) tuple. Replaces orchestrator's hand-rolled
hybrid search loop.

`engine.download_with_fallback(username, filename, file_size,
source_chain)` falls through the chain when a source returns
None / raises. Username hint promotes a matching source-chain
entry to head of order. NOT yet wired into orchestrator.download
— today's username comes from a search result and represents
the user's explicit source pick, so silently falling through
would override their choice. Engine method is available for
future callers that want fallback semantics
(search_and_download_best, automation).

Orchestrator gains _resolve_source_chain helper that builds
the ordered list (hybrid_order config, falling back to legacy
primary/secondary pair). Orchestrator.search hands chain off
to engine.search_with_fallback for hybrid mode.

8 new tests pin the fallback semantics: chain ordering,
unconfigured-skip, exception-continue, empty-when-exhausted,
username-hint promotion. Suite still green (2050 passed).
2026-05-04 14:58:27 -07:00
..
__init__.py PR4a: lift sync history recording to core/downloads/history.py 2026-04-27 20:37:16 -07:00
test_background_download_worker.py C1: Add BackgroundDownloadWorker to engine 2026-05-04 13:21:41 -07:00
test_deezer_pinning.py C6: Migrate Deezer to engine.worker 2026-05-04 14:02:03 -07:00
test_download_engine.py F: Engine owns hybrid fallback chain 2026-05-04 14:58:27 -07:00
test_download_orchestrator.py B3: Orchestrator delegates query methods to engine 2026-05-04 12:59:04 -07:00
test_downloads_cancel.py PR4b: lift cancel + clear download routes to core/downloads/cancel.py 2026-04-27 21:41:35 -07:00
test_downloads_candidates.py PR6: lift _attempt_download_with_candidates to core/downloads/candidates.py 2026-04-28 22:06:33 -07:00
test_downloads_cleanup.py PR4c: lift _automatic_wishlist_cleanup_after_db_update to core/downloads/cleanup.py 2026-04-27 22:23:41 -07:00
test_downloads_history.py PR4a: lift sync history recording to core/downloads/history.py 2026-04-27 20:37:16 -07:00
test_downloads_lifecycle.py Rename wishlist lifecycle helper 2026-04-30 08:06:02 +03:00
test_downloads_master.py PR4h: lift _run_full_missing_tracks_process to core/downloads/master.py 2026-04-28 10:34:13 -07:00
test_downloads_post_processing.py Trim slow retry from post-processing test 2026-04-28 21:27:01 +03:00
test_downloads_staging.py Lift _try_staging_match to core/downloads/staging.py 2026-04-28 23:26:15 -07:00
test_downloads_status.py PR4e: lift status helpers + 3 routes to core/downloads/status.py 2026-04-27 23:26:26 -07:00
test_downloads_task_worker.py PR4f: lift _download_track_worker to core/downloads/task_worker.py 2026-04-28 07:50:01 -07:00
test_hifi_pinning.py C5: Migrate HiFi to engine.worker 2026-05-04 13:57:01 -07:00
test_lidarr_pinning.py A8: Pin LidarrDownloadClient download lifecycle behavior 2026-05-04 12:10:49 -07:00
test_qobuz_pinning.py C4: Migrate Qobuz to engine.worker 2026-05-04 13:52:55 -07:00
test_rate_limit_policy.py E1: Add RateLimitPolicy declaration mechanism 2026-05-04 14:38:20 -07:00
test_soulseek_pinning.py A1: Pin SoulseekClient download lifecycle behavior 2026-05-04 11:45:44 -07:00
test_soundcloud_pinning.py C7: Migrate SoundCloud to engine.worker 2026-05-04 14:24:50 -07:00
test_tidal_pinning.py C3: Migrate Tidal to engine.worker 2026-05-04 13:49:36 -07:00
test_youtube_pinning.py E2: Migrate YouTube to declared rate-limit policy 2026-05-04 14:45:52 -07:00