Skip to content

Commit 4893cee

Browse files
nicomemsnejus
authored andcommitted
Fix the MusicBrainz search not taking into account the album/recording aliases
1 parent 66864fc commit 4893cee

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

beetsplug/musicbrainz.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,7 @@ def get_album_criteria(
771771
) -> dict[str, str]:
772772
criteria = {
773773
"release": album,
774+
"alias": album,
774775
"tracks": str(len(items)),
775776
} | ({"arid": VARIOUS_ARTISTS_ID} if va_likely else {"artist": artist})
776777

@@ -826,7 +827,7 @@ def candidates(
826827
def item_candidates(
827828
self, item: Item, artist: str, title: str
828829
) -> Iterator[beets.autotag.hooks.TrackInfo]:
829-
criteria = {"artist": artist, "recording": title}
830+
criteria = {"artist": artist, "recording": title, "alias": title}
830831

831832
yield from filter(
832833
None, map(self.track_info, self._search_api("recording", criteria))

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Bug fixes:
3737
* Fix ``HiddenFileTest`` by using ``bytestring_path()``.
3838
* tests: Fix tests failing without ``langdetect`` (by making it required).
3939
:bug:`5797`
40+
* :doc:`plugins/musicbrainz`: Fix the MusicBrainz search not taking into
41+
account the album/recording aliases
4042

4143
For packagers:
4244

test/plugins/test_musicbrainz.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,7 @@ def test_get_album_criteria(
10251025

10261026
assert mb.get_album_criteria(items, "Artist ", " Album", va_likely) == {
10271027
"release": " Album",
1028+
"alias": " Album",
10281029
"tracks": str(len(items)),
10291030
**expected_additional_criteria,
10301031
}

0 commit comments

Comments
 (0)