mirror of
https://github.com/beetbox/beets.git
synced 2025-12-07 17:16:07 +01:00
Fixes, test improvement, rebase to master
This commit is contained in:
parent
43f2d423fa
commit
b61306ea0d
3 changed files with 10 additions and 41 deletions
|
|
@ -654,17 +654,17 @@ class DiscogsPlugin(MetadataSourcePlugin):
|
||||||
if not artist:
|
if not artist:
|
||||||
artist = album_artist
|
artist = album_artist
|
||||||
artist_id = album_artist_id
|
artist_id = album_artist_id
|
||||||
artist = self.strip_disambiguation(artist)
|
|
||||||
length = self.get_track_length(track["duration"])
|
length = self.get_track_length(track["duration"])
|
||||||
# Add featured artists
|
# Add featured artists
|
||||||
extraartists = track.get("extraartists", [])
|
extraartists = track.get("extraartists", [])
|
||||||
featured = [
|
featured = [
|
||||||
artist["name"]
|
artist["name"]
|
||||||
for artist in extraartists
|
for artist in extraartists
|
||||||
if artist["role"].find("Featuring") != -1
|
if "Featuring" in artist["role"]
|
||||||
]
|
]
|
||||||
if featured:
|
if featured:
|
||||||
artist = f"{artist} feat. {', '.join(featured)}"
|
artist = f"{artist} feat. {', '.join(featured)}"
|
||||||
|
artist = self.strip_disambiguation(artist)
|
||||||
return TrackInfo(
|
return TrackInfo(
|
||||||
title=title,
|
title=title,
|
||||||
track_id=track_id,
|
track_id=track_id,
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ New features:
|
||||||
converted files.
|
converted files.
|
||||||
- :doc:`plugins/discogs`: New config option `strip_disambiguation` to toggle
|
- :doc:`plugins/discogs`: New config option `strip_disambiguation` to toggle
|
||||||
stripping discogs numeric disambiguation on artist and label fields.
|
stripping discogs numeric disambiguation on artist and label fields.
|
||||||
|
- :doc:`plugins/discogs` Added support for featured artists.
|
||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
|
|
||||||
|
|
@ -27,8 +28,6 @@ Bug fixes:
|
||||||
matching. :bug:`5189`
|
matching. :bug:`5189`
|
||||||
- :doc:`plugins/discogs` Fixed inconsistency in stripping disambiguation from
|
- :doc:`plugins/discogs` Fixed inconsistency in stripping disambiguation from
|
||||||
artists but not labels. :bug:`5366`
|
artists but not labels. :bug:`5366`
|
||||||
- :doc:`plugins/discogs` Fixed issue with ignoring featured artists in the
|
|
||||||
extraartists field.
|
|
||||||
|
|
||||||
For packagers:
|
For packagers:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -450,6 +450,7 @@ class DGAlbumInfoTest(BeetsTestCase):
|
||||||
assert d.artist == "ARTIST NAME (2) & OTHER ARTIST (5)"
|
assert d.artist == "ARTIST NAME (2) & OTHER ARTIST (5)"
|
||||||
assert d.tracks[0].artist == "TEST ARTIST (5)"
|
assert d.tracks[0].artist == "TEST ARTIST (5)"
|
||||||
assert d.label == "LABEL NAME (5)"
|
assert d.label == "LABEL NAME (5)"
|
||||||
|
config["discogs"]["strip_disambiguation"] = True
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
|
@ -461,48 +462,17 @@ class DGAlbumInfoTest(BeetsTestCase):
|
||||||
"title": "track",
|
"title": "track",
|
||||||
"position": "1",
|
"position": "1",
|
||||||
"duration": "5:00",
|
"duration": "5:00",
|
||||||
"extraartists": [
|
"artists": [
|
||||||
{
|
{"name": "NEW ARTIST", "tracks": "", "id": 11146},
|
||||||
"name": "MUSICIAN",
|
{"name": "VOCALIST", "tracks": "", "id": 344, "join": "&"},
|
||||||
"role": "Featuring",
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
},
|
|
||||||
"ARTIST feat. MUSICIAN",
|
|
||||||
),
|
|
||||||
(
|
|
||||||
{
|
|
||||||
"type_": "track",
|
|
||||||
"title": "track",
|
|
||||||
"position": "1",
|
|
||||||
"duration": "5:00",
|
|
||||||
"extraartists": [
|
|
||||||
{
|
|
||||||
"name": "PERFORMER",
|
|
||||||
"role": "Other Role, Featuring",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "MUSICIAN",
|
|
||||||
"role": "Featuring",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
"ARTIST feat. PERFORMER, MUSICIAN",
|
|
||||||
),
|
|
||||||
(
|
|
||||||
{
|
|
||||||
"type_": "track",
|
|
||||||
"title": "track",
|
|
||||||
"position": "1",
|
|
||||||
"duration": "5:00",
|
|
||||||
"artists": [{"name": "NEW ARTIST", "tracks": "", "id": 11146}],
|
|
||||||
"extraartists": [
|
"extraartists": [
|
||||||
{
|
{
|
||||||
"name": "SOLOIST",
|
"name": "SOLOIST",
|
||||||
"role": "Featuring",
|
"role": "Featuring",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "PERFORMER",
|
"name": "PERFORMER (1)",
|
||||||
"role": "Other Role, Featuring",
|
"role": "Other Role, Featuring",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -511,11 +481,11 @@ class DGAlbumInfoTest(BeetsTestCase):
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "MUSICIAN",
|
"name": "MUSICIAN",
|
||||||
"role": "Featuring",
|
"role": "Featuring [Uncredited]",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"NEW ARTIST feat. SOLOIST, PERFORMER, MUSICIAN",
|
"NEW ARTIST, VOCALIST feat. SOLOIST, PERFORMER, MUSICIAN",
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue