Fix #1939538 [Single metadata edit dialog always chages the tags even if not modified](https://bugs.launchpad.net/calibre/+bug/1939538)

This commit is contained in:
Kovid Goyal 2021-08-12 12:12:30 +05:30
parent e2c9a16829
commit f16d7fb89f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1361,6 +1361,7 @@ class RatingEdit(RatingEditor, ToMetadataMixin): # {{{
self.original_val = self.current_val self.original_val = self.current_val
def commit(self, db, id_): def commit(self, db, id_):
if self.current_val != self.original_val:
db.set_rating(id_, self.current_val, notify=False, commit=False) db.set_rating(id_, self.current_val, notify=False, commit=False)
return True return True
@ -1441,6 +1442,7 @@ class TagsEdit(EditWithComplete, ToMetadataMixin): # {{{
self.update_items_cache(db.new_api.all_field_names('tags')) self.update_items_cache(db.new_api.all_field_names('tags'))
def commit(self, db, id_): def commit(self, db, id_):
if self.changed:
self.books_to_refresh |= db.set_tags( self.books_to_refresh |= db.set_tags(
id_, self.current_val, notify=False, commit=False, id_, self.current_val, notify=False, commit=False,
allow_case_change=True) allow_case_change=True)