mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1360806: allow book.smart_update to copy "null" (Unknown) author information to the destination if the destination author and author_sort values are null. There is a small performance hit if the source of the copy is null, which fortunately is rather rare. This change better supports non-null author_sort values associated with null author values.
This commit is contained in:
parent
a9dab307fb
commit
bac30e2e67
@ -471,7 +471,11 @@ class Metadata(object):
|
||||
if hasattr(other, 'title_sort'):
|
||||
self.title_sort = other.title_sort
|
||||
|
||||
if other.authors and other.authors[0] != _('Unknown'):
|
||||
if other.authors and (other.authors[0] != _('Unknown') or
|
||||
(not self.authors or (len(self.authors) == 1 and
|
||||
self.authors[0] == _('Unknown') and
|
||||
hasattr(self, 'author_sort') and
|
||||
self.author_sort == _('Unknown')))):
|
||||
self.authors = list(other.authors)
|
||||
if hasattr(other, 'author_sort_map'):
|
||||
self.author_sort_map = dict(other.author_sort_map)
|
||||
|
Loading…
x
Reference in New Issue
Block a user