mirror of
https://github.com/beetbox/beets.git
synced 2026-03-20 20:31:39 +01:00
test updates, one case still failing
This commit is contained in:
parent
5a43d6add4
commit
0ec6689395
2 changed files with 15 additions and 16 deletions
|
|
@ -349,19 +349,17 @@ class DiscogsPlugin(MetadataSourcePlugin):
|
|||
|
||||
artist_data = [a.data for a in result.artists]
|
||||
album_artist, album_artist_id = self.get_artist(artist_data,
|
||||
self.config["album_artist_anv"]
|
||||
)
|
||||
self.config["album_artist_anv"])
|
||||
artist_credit, _ = self.get_artist(artist_data,
|
||||
self.config["artist_credit_anv"]
|
||||
)
|
||||
self.config["artist_credit_anv"])
|
||||
album = re.sub(r" +", " ", result.title)
|
||||
album_id = result.data["id"]
|
||||
# Use `.data` to access the tracklist directly instead of the
|
||||
# convenient `.tracklist` property, which will strip out useful artist
|
||||
# information and leave us with skeleton `Artist` objects that will
|
||||
# each make an API call just to get the same data back.
|
||||
tracks = self.get_tracks(result.data["tracklist"], (album_artist, album_artist_id,
|
||||
artist_credit))
|
||||
tracks = self.get_tracks(result.data["tracklist"],
|
||||
(album_artist, album_artist_id, artist_credit))
|
||||
|
||||
# Extract information for the optional AlbumInfo fields, if possible.
|
||||
va = result.data["artists"][0].get("name", "").lower() == "various"
|
||||
|
|
@ -672,7 +670,7 @@ class DiscogsPlugin(MetadataSourcePlugin):
|
|||
medium, medium_index, _ = self.get_track_index(track["position"])
|
||||
|
||||
artist = album_artist
|
||||
artist_credit = album_artist
|
||||
artist_credit = artist_credit
|
||||
artist_id = album_artist_id
|
||||
|
||||
# If artists are found on the track, we will use those instead
|
||||
|
|
|
|||
|
|
@ -453,11 +453,12 @@ class DGAlbumInfoTest(BeetsTestCase):
|
|||
config["discogs"]["strip_disambiguation"] = True
|
||||
|
||||
def test_use_anv(self):
|
||||
""" Test using artist name variations. """
|
||||
test_cases = [
|
||||
({
|
||||
"track_artist": False,
|
||||
"album_artist": False,
|
||||
"artist_credit": False
|
||||
"track_artist_anv": False,
|
||||
"album_artist_anv": False,
|
||||
"artist_credit_anv": False
|
||||
},
|
||||
{
|
||||
"album_artist": "ARTIST NAME & SOLOIST",
|
||||
|
|
@ -466,9 +467,9 @@ class DGAlbumInfoTest(BeetsTestCase):
|
|||
"track_artist_credit": "ARTIST Feat. PERFORMER"
|
||||
}),
|
||||
({
|
||||
"track_artist": True,
|
||||
"album_artist": False,
|
||||
"artist_credit": False
|
||||
"track_artist_anv": True,
|
||||
"album_artist_anv": False,
|
||||
"artist_credit_anv": False
|
||||
},
|
||||
{
|
||||
"album_artist": "ARTIST NAME & SOLOIST",
|
||||
|
|
@ -510,10 +511,10 @@ class DGAlbumInfoTest(BeetsTestCase):
|
|||
)
|
||||
for test_case in test_cases:
|
||||
config_input, expected_output = test_case
|
||||
config["discogs"]["album_artist_anv"] = config_input["album_artist_anv"]
|
||||
config["discogs"]["track_artist_anv"] = config_input["track_artist_anv"]
|
||||
config["discogs"]["artist_credit_anv"] = config_input["artist_credit_anv"]
|
||||
r = DiscogsPlugin().get_album_info(release)
|
||||
config["album_artist_anv"] = config_input["album_artist"]
|
||||
config["track_artist_anv"] = config_input["track_artist"]
|
||||
config["artist_credit_anv"] = config_input["artist_credit"]
|
||||
assert r.artist == expected_output["album_artist"]
|
||||
assert r.artist_credit == expected_output["album_artist_credit"]
|
||||
assert r.tracks[0].artist == expected_output["track_artist"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue