From 32e9e58a3526afd6318d5a9aeb88f7a6db94e546 Mon Sep 17 00:00:00 2001 From: InvisibleFunction <3682184+InvisibleFunction@users.noreply.github.com> Date: Fri, 22 Nov 2024 22:33:09 -0500 Subject: [PATCH] Fix SACD Imports --- beets/autotag/match.py | 4 ++++ beets/config_default.yaml | 1 + docs/changelog.rst | 3 +++ 3 files changed, 8 insertions(+) diff --git a/beets/autotag/match.py b/beets/autotag/match.py index 331a57596e..8acda2bce0 100644 --- a/beets/autotag/match.py +++ b/beets/autotag/match.py @@ -208,6 +208,10 @@ def track_distance( if item.mb_trackid: dist.add_expr("track_id", item.mb_trackid != track_info.track_id) + # Penalize mismatching disc numbers. + if track_info.medium and item.disc: + dist.add_expr("medium", item.disc != track_info.medium) + # Plugins. dist.update(plugins.track_distance(item, track_info)) diff --git a/beets/config_default.yaml b/beets/config_default.yaml index b28165c2cf..c5cebd441b 100644 --- a/beets/config_default.yaml +++ b/beets/config_default.yaml @@ -207,6 +207,7 @@ match: track_index: 1.0 track_length: 2.0 track_id: 5.0 + medium: 1.0 preferred: countries: [] media: [] diff --git a/docs/changelog.rst b/docs/changelog.rst index 90b87dcf60..93685a8236 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -17,6 +17,9 @@ Bug fixes: * Check if running python from the Microsoft Store and provide feedback to install from python.org. :bug:`5467` +* Fix bug where matcher doesn't consider medium number when importing. This makes + it difficult to import hybrid SACDs and other releases with duplicate tracks. + :bug:`5148` For packagers: