mirror of
https://github.com/beetbox/beets.git
synced 2026-02-10 09:25:42 +01:00
edit: Fix a regression from #2659 when re-tagging albums
This commit is contained in:
parent
989845199b
commit
33f7e67943
1 changed files with 5 additions and 4 deletions
|
|
@ -283,7 +283,7 @@ class EditPlugin(plugins.BeetsPlugin):
|
|||
# Show the changes.
|
||||
# If the objects are not on the DB yet, we need a copy of their
|
||||
# original state for show_model_changes.
|
||||
objs_old = [deepcopy(obj) if not obj._db else None
|
||||
objs_old = [deepcopy(obj) if obj.id < 0 else None
|
||||
for obj in objs]
|
||||
self.apply_data(objs, old_data, new_data)
|
||||
changed = False
|
||||
|
|
@ -308,7 +308,7 @@ class EditPlugin(plugins.BeetsPlugin):
|
|||
objs = [(old_obj or obj)
|
||||
for old_obj, obj in zip(objs_old, objs)]
|
||||
for obj in objs:
|
||||
if obj._db:
|
||||
if not obj.id < 0:
|
||||
obj.load()
|
||||
continue
|
||||
|
||||
|
|
@ -374,7 +374,8 @@ class EditPlugin(plugins.BeetsPlugin):
|
|||
# yet. By using negative values, no clash with items in the database
|
||||
# can occur.
|
||||
for i, obj in enumerate(task.items, start=1):
|
||||
if not obj._db:
|
||||
# The importer may set the id to None when re-importing albums.
|
||||
if not obj._db or obj.id is None:
|
||||
obj.id = -i
|
||||
|
||||
# Present the YAML to the user and let her change it.
|
||||
|
|
@ -383,7 +384,7 @@ class EditPlugin(plugins.BeetsPlugin):
|
|||
|
||||
# Remove temporary ids.
|
||||
for obj in task.items:
|
||||
if not obj._db:
|
||||
if obj.id < 0:
|
||||
obj.id = None
|
||||
|
||||
# Save the new data.
|
||||
|
|
|
|||
Loading…
Reference in a new issue