Fixes wrong metadata field used in VA album serialization
This commit is contained in:
parent
27e9e71373
commit
ecf81eee88
|
@ -480,8 +480,8 @@ class ArtistField(serializers.Field):
|
||||||
def get_value(self, data):
|
def get_value(self, data):
|
||||||
if self.for_album:
|
if self.for_album:
|
||||||
keys = [
|
keys = [
|
||||||
("artists", "artists"),
|
("artists", "album_artist"),
|
||||||
("names", "album_artist"),
|
("names", "artists"),
|
||||||
("mbids", "musicbrainz_albumartistid"),
|
("mbids", "musicbrainz_albumartistid"),
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
|
@ -525,7 +525,14 @@ class ArtistField(serializers.Field):
|
||||||
if separator in data["artists"]:
|
if separator in data["artists"]:
|
||||||
names = [n.strip() for n in data["artists"].split(separator)]
|
names = [n.strip() for n in data["artists"].split(separator)]
|
||||||
break
|
break
|
||||||
if not names:
|
# corner case: 'album artist' field with only one artist but multiple names in 'artits' field
|
||||||
|
if (
|
||||||
|
not names
|
||||||
|
and data.get("names", None)
|
||||||
|
and any(separator in data["names"] for separator in separators)
|
||||||
|
):
|
||||||
|
names = [n.strip() for n in data["names"].split(separators[0])]
|
||||||
|
elif not names:
|
||||||
names = [data["artists"]]
|
names = [data["artists"]]
|
||||||
elif used_separator and mbids:
|
elif used_separator and mbids:
|
||||||
names = [n.strip() for n in data["names"].split(used_separator)]
|
names = [n.strip() for n in data["names"].split(used_separator)]
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Fixed metadata handling for Various Artists albums (#1201)
|
Loading…
Reference in New Issue