diff --git a/src/calibre/gui2/author_mapper.py b/src/calibre/gui2/author_mapper.py index 378dfe3ccc..1605793d4b 100644 --- a/src/calibre/gui2/author_mapper.py +++ b/src/calibre/gui2/author_mapper.py @@ -38,6 +38,7 @@ class RuleEdit(RuleEditBase): SUBJECT = _('the author, if the author name') VALUE_ERROR = _('You must provide a value for the author name to match') REPLACE_TEXT = _('with the name:') + SINGLE_EDIT_FIELD_NAME = 'authors' @property def can_use_tag_editor(self): diff --git a/src/calibre/gui2/tag_mapper.py b/src/calibre/gui2/tag_mapper.py index c14c84d5c7..a4266e93fa 100644 --- a/src/calibre/gui2/tag_mapper.py +++ b/src/calibre/gui2/tag_mapper.py @@ -45,7 +45,7 @@ class SingleTagEdit(EditWithComplete): self.set_separator(None) gui = get_gui() if gui: - self.update_items_cache(gui.current_db.new_api.all_field_names('tags')) + self.update_items_cache(gui.current_db.new_api.all_field_names(getattr(parent, 'SINGLE_EDIT_FIELD_NAME', 'tags'))) class RuleEdit(QWidget): @@ -82,6 +82,7 @@ class RuleEdit(QWidget): ' tags, you can replace with parts of the matched pattern. See ' ' the User Manual on how to use regular expressions for details.') REGEXP_HELP_TEXT = _('For help with regex pattern matching, see the User Manual') + SINGLE_EDIT_FIELD_NAME = 'tags' def __init__(self, parent=None): QWidget.__init__(self, parent)