soulsync/core/imports
dev ab05508acc feat(quality): rank-based candidate ordering toggle for priority mode
Adds an opt-in `rank_candidates_by_quality` profile flag. When on, the
priority-mode download walk orders candidates by the ranked-target quality
(confidence/speed only break ties) instead of confidence-first. Default off
keeps the byte-for-byte old behaviour, so existing installs are unaffected.

Best-quality search mode is always quality-first regardless of the flag; the
toggle only affects priority mode. Search-time source selection is unchanged —
nothing is skipped, so a track can never go missing, only the order in which
copies are tried changes.

The version-mismatch force-import follows automatically: it accepts the
first-tried (= best-ordered) quarantined candidate, which is the highest-quality
one once the walk is quality-first. No change to its selection logic needed.

- core/quality/selection.py: load_rank_candidates_by_quality() (fail-closed).
- core/downloads/task_worker.py: _best_quality_ordering -> _candidate_ordering;
  quality-first when best_quality mode OR the toggle is on.
- database/music_database.py: default profile carries the flag (False).
- web_server.py: flag is preserved globally across preset apply/reset, like
  search_mode.
- core/imports/version_mismatch_fallback.py: comment clarified (no behaviour
  change).

Tests (TDD): load_rank_candidates_by_quality default/enabled/disabled/error;
_candidate_ordering across all mode+toggle combinations + fail-closed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 22:00:57 +02:00
..
__init__.py Rehome import helpers into core/imports 2026-04-27 19:54:44 +03:00
album.py Show MusicBrainz release variants in import 2026-05-24 09:33:19 -07:00
album_grouping.py lint: log the skipped album source-id lookup instead of a bare try/except/pass (ruff S110) 2026-06-18 12:09:22 -07:00
album_matching.py #890: strip leading track-number prefix from filename-derived titles 2026-06-18 18:35:04 -07:00
album_naming.py Rehome import helpers into core/imports 2026-04-27 19:54:44 +03:00
album_position.py Auto-download: resolve an album track's real position from its album (not 1/1) 2026-06-22 13:32:24 -07:00
context.py Auto-download: resolve an album track's real position from its album (not 1/1) 2026-06-22 13:32:24 -07:00
file_integrity.py Import: don't duration-quarantine manual imports against a re-resolved release (#804) 2026-06-07 23:02:34 -07:00
file_ops.py Merge pull request #896 from nick2000713/feature/best-quality-search-mode 2026-06-24 20:27:38 -07:00
filename.py Fix album-bundle downloads landing every track as track 1 2026-05-26 21:04:27 -07:00
folder_artist.py Use app confirm modal for verification review actions 2026-06-11 01:53:05 +02:00
guards.py feat(import): master toggle for quality-filtering on import + collapsible tile 2026-06-15 15:29:29 +02:00
paths.py #890: strip leading track-number prefix from filename-derived titles 2026-06-18 18:35:04 -07:00
pipeline.py fix(quarantine): discard late quarantine entries when alternative approved 2026-06-24 13:04:06 +02:00
quarantine.py fix(quarantine): use name-based group key across batches/sources 2026-06-24 12:48:04 +02:00
rematch_apply.py #889 Phase 4: the Re-identify modal + apply backend 2026-06-18 15:37:56 -07:00
rematch_hints.py #889: FIX data loss — re-identify to the same release no longer deletes the file 2026-06-18 17:13:46 -07:00
rematch_search.py #889 Phase 3: re-identify search — multi-source track→release lookup + API 2026-06-18 15:31:33 -07:00
resolution.py Surface silent exceptions across remaining modules — ~70 sites 2026-05-07 10:28:58 -07:00
routes.py #922: import search labelled Spotify Free users' primary source as 'Deezer' 2026-06-24 08:43:52 -07:00
side_effects.py merge: pull upstream/main (2.7.4) into feature/best-quality-search-mode 2026-06-19 16:54:51 +02:00
silence.py perf(imports): single-pass ffmpeg audio guard + opt-in toggle (default off) 2026-06-23 12:07:28 +02:00
single_to_album.py Library: single->parent-album resolution core (pure selector + injected-I/O resolver) 2026-06-18 09:24:06 -07:00
staging.py #922: import search labelled Spotify Free users' primary source as 'Deezer' 2026-06-24 08:43:52 -07:00
tag_policy.py Import: never wipe a clean/matched import's tags when enhancement fails (#804) 2026-06-07 22:44:43 -07:00
track_number.py Multi-disc: file the track in the disc folder that matches its tag (Sokhi) 2026-06-22 10:56:53 -07:00
version_mismatch_fallback.py feat(quality): rank-based candidate ordering toggle for priority mode 2026-06-25 22:00:57 +02:00