mirror of
https://github.com/beetbox/beets.git
synced 2026-01-08 17:08:12 +01:00
edit: Correctly reset the old object, do not reload it from the tags
Previously, if continuing to edit (i.e. invoking the $EDITOR) multiple times in one invocation of EditPlugin.edit_objects, the plugin would reload the old state from the file tags. The initial 'old state' is usually only loaded from the database, though. As a consequence, if database and tags were not in sync, the diffs from first and all subsequent edits could differ unexpectedly.
This commit is contained in:
parent
e983929e52
commit
989845199b
1 changed files with 7 additions and 2 deletions
|
|
@ -302,9 +302,14 @@ class EditPlugin(plugins.BeetsPlugin):
|
|||
elif choice == u'c': # Cancel.
|
||||
return False
|
||||
elif choice == u'e': # Keep editing.
|
||||
# Reset the temporary changes to the objects.
|
||||
# Reset the temporary changes to the objects. I we have a
|
||||
# deepcopy from above, use that, else reload from the
|
||||
# database.
|
||||
objs = [(old_obj or obj)
|
||||
for old_obj, obj in zip(objs_old, objs)]
|
||||
for obj in objs:
|
||||
obj.read()
|
||||
if obj._db:
|
||||
obj.load()
|
||||
continue
|
||||
|
||||
# Remove the temporary file before returning.
|
||||
|
|
|
|||
Loading…
Reference in a new issue