Commit 8fd20b9
authored
Fix the MusicBrainz search not taking into account the album/recording aliases (#5821)
When searching on MusicBrainz, beets does not add the `alias` field that
allows for searching on the entity aliases.
As per [the MusicBrainz Indexed Search
Syntax](https://musicbrainz.org/doc/Indexed_Search_Syntax#Search_Fields_9):
> alias | (part of) any alias attached to the release group (diacritics
are ignored)
> [...]
> release | (part of) the title of any of the releases in the release
group
By adding the `alias` field assigned with the entity title, the search
returns better results for titles that can be aliased.
The problem can be reproduced with the following album:
https://musicbrainz.org/release-group/b5b4eed2-e871-4268-80bb-7625ee0c6cd0:
- Currently, beets searches using the following query: [`release:(rude
lose dance \- single) tracks:(1)
artist:(minami)`](https://musicbrainz.org/search?query=release%3A%28rude+lose+dance+%5C-+single%29+tracks%3A%281%29+artist%3A%28minami%29&type=release_group&limit=25&method=advanced)
- We can see that the correct album cannot be found (even after 5
pages!)
- With this PR, beets now searches using the following query:
[`release:(rude lose dance \- single) alias:(rude lose dance \- single)
tracks:(1)
artist:(minami)`](https://musicbrainz.org/search?query=release%3A%28rude+lose+dance+%5C-+single%29+alias%3A%28rude+lose+dance+%5C-+single%29+tracks%3A%281%29+artist%3A%28minami%29&type=release_group&limit=25&method=advanced)
- We can see that the correct album is now found in 1st position!
Tests had to be updated due to the addition of the `alias` criteria.File tree
3 files changed
+5
-1
lines changed- beetsplug
- docs
- test/plugins
3 files changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
771 | 771 | | |
772 | 772 | | |
773 | 773 | | |
| 774 | + | |
774 | 775 | | |
775 | 776 | | |
776 | 777 | | |
| |||
826 | 827 | | |
827 | 828 | | |
828 | 829 | | |
829 | | - | |
| 830 | + | |
830 | 831 | | |
831 | 832 | | |
832 | 833 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1025 | 1025 | | |
1026 | 1026 | | |
1027 | 1027 | | |
| 1028 | + | |
1028 | 1029 | | |
1029 | 1030 | | |
1030 | 1031 | | |
| |||
0 commit comments