mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix existing rating not being removed when using Polish Books or Embed Metadata tools on EPUB files. Fixes #1534597 [Polish Books not updating Ratings](https://bugs.launchpad.net/calibre/+bug/1534597)
This commit is contained in:
parent
ebbdf4e704
commit
9187c1e82b
@ -1276,9 +1276,9 @@ class OPF(object): # {{{
|
||||
'isbn', 'tags', 'category', 'comments', 'book_producer',
|
||||
'pubdate', 'user_categories', 'author_link_map'):
|
||||
val = getattr(mi, attr, None)
|
||||
is_null = val is None or val in ((), [], (None, None), {})
|
||||
is_null = val is None or val in ((), [], (None, None), {}) or (attr == 'rating' and val < 0.1)
|
||||
if is_null:
|
||||
if apply_null and attr in {'series', 'tags', 'isbn', 'comments', 'publisher'}:
|
||||
if apply_null and attr in {'series', 'tags', 'isbn', 'comments', 'publisher', 'rating'}:
|
||||
setattr(self, attr, ([] if attr == 'tags' else None))
|
||||
else:
|
||||
setattr(self, attr, val)
|
||||
|
Loading…
x
Reference in New Issue
Block a user