refactor: make adapter .tier the single source of truth for ranking
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6,11 +6,14 @@ CD = Quality(fmt="FLAC", lossless=True, bit_depth=16, sample_rate=44100)
|
||||
MP3 = Quality(fmt="MP3", lossless=False, bitrate_kbps=320)
|
||||
TARGET = MBTarget(artist="Radiohead", album="In Rainbows", track_count=10)
|
||||
|
||||
_TIERS = {"qobuz": 0, "soulseek": 1, "youtube": 2}
|
||||
|
||||
|
||||
def _cand(source, quality, artist="Radiohead", album="In Rainbows", tracks=10):
|
||||
return Candidate(source=source, source_ref=f"{source}:{quality.fmt}",
|
||||
matched_artist=artist, matched_album=album,
|
||||
quality=quality, track_count=tracks)
|
||||
quality=quality, track_count=tracks,
|
||||
source_tier=_TIERS[source])
|
||||
|
||||
|
||||
def test_returns_empty_for_no_candidates():
|
||||
|
||||
Reference in New Issue
Block a user