mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 16:42:42 +01:00
Fix the MusicBrainz search not taking into account the album/recording aliases
This commit is contained in:
parent
66864fcc27
commit
4893cee5e5
3 changed files with 5 additions and 1 deletions
|
|
@ -771,6 +771,7 @@ class MusicBrainzPlugin(BeetsPlugin):
|
||||||
) -> dict[str, str]:
|
) -> dict[str, str]:
|
||||||
criteria = {
|
criteria = {
|
||||||
"release": album,
|
"release": album,
|
||||||
|
"alias": album,
|
||||||
"tracks": str(len(items)),
|
"tracks": str(len(items)),
|
||||||
} | ({"arid": VARIOUS_ARTISTS_ID} if va_likely else {"artist": artist})
|
} | ({"arid": VARIOUS_ARTISTS_ID} if va_likely else {"artist": artist})
|
||||||
|
|
||||||
|
|
@ -826,7 +827,7 @@ class MusicBrainzPlugin(BeetsPlugin):
|
||||||
def item_candidates(
|
def item_candidates(
|
||||||
self, item: Item, artist: str, title: str
|
self, item: Item, artist: str, title: str
|
||||||
) -> Iterator[beets.autotag.hooks.TrackInfo]:
|
) -> Iterator[beets.autotag.hooks.TrackInfo]:
|
||||||
criteria = {"artist": artist, "recording": title}
|
criteria = {"artist": artist, "recording": title, "alias": title}
|
||||||
|
|
||||||
yield from filter(
|
yield from filter(
|
||||||
None, map(self.track_info, self._search_api("recording", criteria))
|
None, map(self.track_info, self._search_api("recording", criteria))
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ Bug fixes:
|
||||||
* Fix ``HiddenFileTest`` by using ``bytestring_path()``.
|
* Fix ``HiddenFileTest`` by using ``bytestring_path()``.
|
||||||
* tests: Fix tests failing without ``langdetect`` (by making it required).
|
* tests: Fix tests failing without ``langdetect`` (by making it required).
|
||||||
:bug:`5797`
|
:bug:`5797`
|
||||||
|
* :doc:`plugins/musicbrainz`: Fix the MusicBrainz search not taking into
|
||||||
|
account the album/recording aliases
|
||||||
|
|
||||||
For packagers:
|
For packagers:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1025,6 +1025,7 @@ class TestMusicBrainzPlugin(PluginMixin):
|
||||||
|
|
||||||
assert mb.get_album_criteria(items, "Artist ", " Album", va_likely) == {
|
assert mb.get_album_criteria(items, "Artist ", " Album", va_likely) == {
|
||||||
"release": " Album",
|
"release": " Album",
|
||||||
|
"alias": " Album",
|
||||||
"tracks": str(len(items)),
|
"tracks": str(len(items)),
|
||||||
**expected_additional_criteria,
|
**expected_additional_criteria,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue