mirror of
https://github.com/beetbox/beets.git
synced 2026-03-25 23:03:48 +01:00
tagging: fix list albumartists field
This commit is contained in:
parent
f3f132942a
commit
79787cfd97
3 changed files with 24 additions and 27 deletions
|
|
@ -307,21 +307,20 @@ def apply_metadata(
|
|||
|
||||
# MusicBrainz IDs.
|
||||
item.mb_trackid = track_info.track_id
|
||||
item.mb_releasetrackid = track_info.release_track_id
|
||||
item.mb_albumid = album_info.album_id
|
||||
if track_info.artist_id:
|
||||
item.mb_artistid = track_info.artist_id
|
||||
else:
|
||||
item.mb_artistid = album_info.artist_id
|
||||
item.mb_releasetrackid = track_info.release_track_id or item.mb_trackid
|
||||
|
||||
if track_info.artists_ids:
|
||||
item.mb_artistids = track_info.artists_ids
|
||||
else:
|
||||
item.mb_artistids = album_info.artists_ids
|
||||
item.mb_albumid = album_info.album_id
|
||||
item.mb_releasegroupid = album_info.releasegroup_id
|
||||
|
||||
item.mb_albumartistid = album_info.artist_id
|
||||
item.mb_albumartistids = album_info.artists_ids
|
||||
item.mb_releasegroupid = album_info.releasegroup_id
|
||||
item.mb_albumartistids = album_info.artists_ids or (
|
||||
[ai] if (ai := item.mb_albumartistid) else []
|
||||
)
|
||||
|
||||
item.mb_artistid = track_info.artist_id or item.mb_albumartistid
|
||||
item.mb_artistids = track_info.artists_ids or (
|
||||
[iai] if (iai := item.mb_artistid) else []
|
||||
)
|
||||
|
||||
# Compilation flag.
|
||||
item.comp = album_info.va
|
||||
|
|
|
|||
|
|
@ -430,14 +430,17 @@ class ImportTask(BaseImportTask):
|
|||
elif self.choice_flag in (Action.APPLY, Action.RETAG):
|
||||
# Applying autotagged metadata. Just get AA from the first
|
||||
# item.
|
||||
if not self.items[0].albumartist:
|
||||
changes["albumartist"] = self.items[0].artist
|
||||
if not self.items[0].albumartists:
|
||||
changes["albumartists"] = self.items[0].artists
|
||||
if not self.items[0].mb_albumartistid:
|
||||
changes["mb_albumartistid"] = self.items[0].mb_artistid
|
||||
if not self.items[0].mb_albumartistids:
|
||||
changes["mb_albumartistids"] = self.items[0].mb_artistids
|
||||
first = self.items[0]
|
||||
if not first.albumartist:
|
||||
changes["albumartist"] = first.artist
|
||||
if not first.albumartists:
|
||||
changes["albumartists"] = first.artists or [first.artist]
|
||||
if not first.mb_albumartistid:
|
||||
changes["mb_albumartistid"] = first.mb_artistid
|
||||
if not first.mb_albumartistids:
|
||||
changes["mb_albumartistids"] = first.mb_artistids or [
|
||||
first.mb_artistid
|
||||
]
|
||||
|
||||
# Apply new metadata.
|
||||
for item in self.items:
|
||||
|
|
|
|||
|
|
@ -353,13 +353,8 @@ class EditDuringImporterNonSingletonTest(EditDuringImporterTestCase):
|
|||
self.assertItemFieldsModified(
|
||||
self.lib.items(),
|
||||
self.items_orig,
|
||||
["title"],
|
||||
[
|
||||
*self.IGNORED,
|
||||
"albumartist",
|
||||
"mb_albumartistid",
|
||||
"mb_albumartistids",
|
||||
],
|
||||
["title", "albumartist", "albumartists"],
|
||||
[*self.IGNORED, "mb_albumartistid", "mb_albumartistids"],
|
||||
)
|
||||
assert all("Edited Track" in i.title for i in self.lib.items())
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue