diff --git a/src/calibre/gui2/actions/edit_metadata.py b/src/calibre/gui2/actions/edit_metadata.py index 718ece46d2..0a56286593 100644 --- a/src/calibre/gui2/actions/edit_metadata.py +++ b/src/calibre/gui2/actions/edit_metadata.py @@ -446,9 +446,8 @@ class EditMetadataAction(InterfaceAction): if d.result() == d.Accepted: to_rename = d.to_rename # dict of new text to old ids to_delete = d.to_delete # list of ids - for text in to_rename: - for old_id in to_rename[text]: - model.rename_collection(old_id, new_name=unicode(text)) + for old_id, new_name in to_rename.iteritems(): + model.rename_collection(old_id, new_name=unicode(new_name)) for item in to_delete: model.delete_collection_using_id(item) self.gui.upload_collections(model.db, view=view, oncard=oncard) diff --git a/src/calibre/gui2/tag_browser/ui.py b/src/calibre/gui2/tag_browser/ui.py index d7e504b3e9..390273e5b2 100644 --- a/src/calibre/gui2/tag_browser/ui.py +++ b/src/calibre/gui2/tag_browser/ui.py @@ -218,7 +218,7 @@ class TagBrowserMixin(object): # {{{ d = TagListEditor(self, tag_to_match=tag, data=result, key=key) d.exec_() if d.result() == d.Accepted: - to_rename = d.to_rename # dict of new text to old id + to_rename = d.to_rename # dict of old id to new name to_delete = d.to_delete # list of ids orig_name = d.original_names # dict of id: name