mirror of
https://github.com/beetbox/beets.git
synced 2025-12-14 04:23:56 +01:00
Exclude ID's when preserving flexible attributes
- Bandcamp, Spotify, Deezer and Beatport ID's are saved in the library as flexible attributes. - On _reimports_ the method importer.ImportTask.reimport_metadata() takes care of preserving existing values for flexible attributes instead of applying new (and potentially empty) values. - In this case we don't want this behaviour and need to make sure that new values are applied. Therefore we check whether such ID's of metadata services are present in the reimported items and exclude them in reimport_metadata().
This commit is contained in:
parent
fd4cecc29e
commit
6acee803f7
1 changed files with 13 additions and 0 deletions
|
|
@ -839,6 +839,19 @@ class ImportTask(BaseImportTask):
|
|||
dup_item.id,
|
||||
displayable_path(item.path)
|
||||
)
|
||||
# We exclude certain flexible attributes from the preserving
|
||||
# process since they might have been fetched from MusicBrainz
|
||||
# and been set in beets.autotag.apply_metadata().
|
||||
# discogs_albumid might also have been set but is not a
|
||||
# flexible attribute, thus no exclude is required.
|
||||
if item.get('bandcamp_album_id'):
|
||||
dup_item.bandcamp_album_id = item.bandcamp_album_id
|
||||
if item.get('spotify_album_id'):
|
||||
dup_item.spotify_album_id = item.spotify_album_id
|
||||
if item.get('deezer_album_id'):
|
||||
dup_item.deezer_album_id = item.deezer_album_id
|
||||
if item.get('beatport_album_id'):
|
||||
dup_item.beatport_album_id = item.beatport_album_id
|
||||
item.update(dup_item._values_flex)
|
||||
log.debug(
|
||||
'Reimported item flexible attributes {0} '
|
||||
|
|
|
|||
Loading…
Reference in a new issue