mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
GwR fixes for tickets 2279, 4652, 5162
This commit is contained in:
parent
5091859c49
commit
9c38a1b5b8
@ -349,6 +349,17 @@ class MetadataUpdater(object):
|
|||||||
if mi.tags:
|
if mi.tags:
|
||||||
subjects = '; '.join(mi.tags)
|
subjects = '; '.join(mi.tags)
|
||||||
update_exth_record((105, subjects.encode(self.codec, 'replace')))
|
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:
|
if mi.pubdate:
|
||||||
update_exth_record((106, str(mi.pubdate).encode(self.codec, 'replace')))
|
update_exth_record((106, str(mi.pubdate).encode(self.codec, 'replace')))
|
||||||
elif mi.timestamp:
|
elif mi.timestamp:
|
||||||
|
@ -359,7 +359,7 @@ class OEBReader(object):
|
|||||||
self._toc_from_navpoint(item, node, child)
|
self._toc_from_navpoint(item, node, child)
|
||||||
|
|
||||||
def _toc_from_ncx(self, item):
|
def _toc_from_ncx(self, item):
|
||||||
if item is None:
|
if (item is None) or (item.data is None):
|
||||||
return False
|
return False
|
||||||
self.log.debug('Reading TOC from NCX...')
|
self.log.debug('Reading TOC from NCX...')
|
||||||
ncx = item.data
|
ncx = item.data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user