mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
GwR fixes for tickets 2279, 4652, 5162
This commit is contained in:
parent
5091859c49
commit
9c38a1b5b8
@ -331,7 +331,7 @@ class MetadataUpdater(object):
|
||||
authors = mi.author_sort
|
||||
update_exth_record((100, authors.encode(self.codec, 'replace')))
|
||||
elif mi.authors:
|
||||
authors = '; '.join(mi.authors)
|
||||
authors = ';'.join(mi.authors)
|
||||
update_exth_record((100, authors.encode(self.codec, 'replace')))
|
||||
if mi.publisher:
|
||||
update_exth_record((101, mi.publisher.encode(self.codec, 'replace')))
|
||||
@ -349,6 +349,17 @@ class MetadataUpdater(object):
|
||||
if mi.tags:
|
||||
subjects = '; '.join(mi.tags)
|
||||
update_exth_record((105, subjects.encode(self.codec, 'replace')))
|
||||
|
||||
# >>> Begin patch for ticket #4652 <<<
|
||||
kindle_doc_types = set([u'[kindle_ebok]',u'[kindle_pdoc]'])
|
||||
doc_type = list(kindle_doc_types.intersection(set(mi.tags)))[0]
|
||||
if doc_type:
|
||||
if doc_type == '[kindle_ebok]':
|
||||
update_exth_record((501,str('EBOK')))
|
||||
elif doc_type == '[kindle_pdoc]':
|
||||
update_exth_record((501, str('PDOC')))
|
||||
# >>> End patch
|
||||
|
||||
if mi.pubdate:
|
||||
update_exth_record((106, str(mi.pubdate).encode(self.codec, 'replace')))
|
||||
elif mi.timestamp:
|
||||
|
@ -359,7 +359,7 @@ class OEBReader(object):
|
||||
self._toc_from_navpoint(item, node, child)
|
||||
|
||||
def _toc_from_ncx(self, item):
|
||||
if item is None:
|
||||
if (item is None) or (item.data is None):
|
||||
return False
|
||||
self.log.debug('Reading TOC from NCX...')
|
||||
ncx = item.data
|
||||
|
Loading…
x
Reference in New Issue
Block a user