diff --git a/beetsplug/edit.py b/beetsplug/edit.py index b72b033df..29676fa08 100644 --- a/beetsplug/edit.py +++ b/beetsplug/edit.py @@ -323,4 +323,4 @@ class EditPlugin(plugins.BeetsPlugin): for ob in objs: if ob._dirty: self._log.debug('saving changes to {}', ob) - ob.try_sync(ui.should_write(), False) + ob.try_sync(ui.should_write(), ui.should_move()) diff --git a/docs/changelog.rst b/docs/changelog.rst index b39355700..1110a3043 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -39,6 +39,8 @@ Fixes: major version so ``warning_treshold`` will still work. Thanks to :user:`JesseWeinstein`. :bug:`1802` :bug:`1803` * :doc:`/plugins/lyrics`: The Genius backend has been re-enabled. +* :doc:`/plugins/edit`: Editing metadata now moves files, when appropriate + (like the :ref:`modify-cmd` command). :bug:`1804` diff --git a/test/test_edit.py b/test/test_edit.py index 727de6d20..522437eaa 100644 --- a/test/test_edit.py +++ b/test/test_edit.py @@ -107,19 +107,21 @@ class EditCommandTest(unittest.TestCase, TestHelper): self.assertTrue(all(i.title.startswith(title_starts_with) for i in self.lib.items())) - def assertItemFieldsModified(self, library_items, items, fields=[]): + def assertItemFieldsModified(self, library_items, items, fields=[], + allowed=['path']): """Assert that items in the library (`lib_items`) have different values on the specified `fields` (and *only* on those fields), compared to `items`. + An empty `fields` list results in asserting that no modifications have - been performed. + been performed. `allowed` is a list of field changes that are ignored + (they may or may not have changed; the assertion doesn't care). """ - changed_fields = [] for lib_item, item in zip(library_items, items): - changed_fields.append([field for field in lib_item._fields - if lib_item[field] != item[field]]) - self.assertTrue(all(diff_fields == fields for diff_fields in - changed_fields)) + diff_fields = [field for field in lib_item._fields + if lib_item[field] != item[field]] + self.assertEqual(set(diff_fields).difference(allowed), + set(fields)) def test_title_edit_discard(self): """Edit title for all items in the library, then discard changes-"""