mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1360806 [{author_sort} ignored (when saving and in plugboards) when book has no author](https://bugs.launchpad.net/calibre/+bug/1360806)
Merge branch 'master' of https://github.com/cbhaley/calibre
This commit is contained in:
commit
3c71dfb65f
@ -466,12 +466,20 @@ class Metadata(object):
|
|||||||
if v not in (None, NULL_VALUES.get(attr, None)):
|
if v not in (None, NULL_VALUES.get(attr, None)):
|
||||||
setattr(dest, attr, copy.deepcopy(v))
|
setattr(dest, attr, copy.deepcopy(v))
|
||||||
|
|
||||||
if other.title and other.title != _('Unknown'):
|
unknown = _('Unknown')
|
||||||
|
if other.title and other.title != unknown:
|
||||||
self.title = other.title
|
self.title = other.title
|
||||||
if hasattr(other, 'title_sort'):
|
if hasattr(other, 'title_sort'):
|
||||||
self.title_sort = 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
|
||||||
|
getattr(self, 'author_sort', None) == unknown
|
||||||
|
)
|
||||||
|
)
|
||||||
|
):
|
||||||
self.authors = list(other.authors)
|
self.authors = list(other.authors)
|
||||||
if hasattr(other, 'author_sort_map'):
|
if hasattr(other, 'author_sort_map'):
|
||||||
self.author_sort_map = dict(other.author_sort_map)
|
self.author_sort_map = dict(other.author_sort_map)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user