mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +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:
|
||||
artist = album_artist
|
||||
artist_id = album_artist_id
|
||||
artist = self.strip_disambiguation(artist)
|
||||
length = self.get_track_length(track["duration"])
|
||||
# Add featured artists
|
||||
extraartists = track.get("extraartists", [])
|
||||
featured = [
|
||||
artist["name"]
|
||||
for artist in extraartists
|
||||
if artist["role"].find("Featuring") != -1
|
||||
if "Featuring" in artist["role"]
|
||||
]
|
||||
if featured:
|
||||
artist = f"{artist} feat. {', '.join(featured)}"
|
||||
artist = self.strip_disambiguation(artist)
|
||||
return TrackInfo(
|
||||
title=title,
|
||||
track_id=track_id,
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ New features:
|
|||
converted files.
|
||||
- :doc:`plugins/discogs`: New config option `strip_disambiguation` to toggle
|
||||
stripping discogs numeric disambiguation on artist and label fields.
|
||||
- :doc:`plugins/discogs` Added support for featured artists.
|
||||
|
||||
Bug fixes:
|
||||
|
||||
|
|
@ -27,8 +28,6 @@ Bug fixes:
|
|||
matching. :bug:`5189`
|
||||
- :doc:`plugins/discogs` Fixed inconsistency in stripping disambiguation from
|
||||
artists but not labels. :bug:`5366`
|
||||
- :doc:`plugins/discogs` Fixed issue with ignoring featured artists in the
|
||||
extraartists field.
|
||||
|
||||
For packagers:
|
||||
|
||||
|
|
|
|||
|
|
@ -450,6 +450,7 @@ class DGAlbumInfoTest(BeetsTestCase):
|
|||
assert d.artist == "ARTIST NAME (2) & OTHER ARTIST (5)"
|
||||
assert d.tracks[0].artist == "TEST ARTIST (5)"
|
||||
assert d.label == "LABEL NAME (5)"
|
||||
config["discogs"]["strip_disambiguation"] = True
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
@ -461,48 +462,17 @@ class DGAlbumInfoTest(BeetsTestCase):
|
|||
"title": "track",
|
||||
"position": "1",
|
||||
"duration": "5:00",
|
||||
"extraartists": [
|
||||
{
|
||||
"name": "MUSICIAN",
|
||||
"role": "Featuring",
|
||||
}
|
||||
"artists": [
|
||||
{"name": "NEW ARTIST", "tracks": "", "id": 11146},
|
||||
{"name": "VOCALIST", "tracks": "", "id": 344, "join": "&"},
|
||||
],
|
||||
},
|
||||
"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": [
|
||||
{
|
||||
"name": "SOLOIST",
|
||||
"role": "Featuring",
|
||||
},
|
||||
{
|
||||
"name": "PERFORMER",
|
||||
"name": "PERFORMER (1)",
|
||||
"role": "Other Role, Featuring",
|
||||
},
|
||||
{
|
||||
|
|
@ -511,11 +481,11 @@ class DGAlbumInfoTest(BeetsTestCase):
|
|||
},
|
||||
{
|
||||
"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