Revert KF8 EXTH field changes

This commit is contained in:
Kovid Goyal 2012-07-15 11:15:44 +05:30
parent e8e109a25a
commit 77208efb4b
2 changed files with 6 additions and 10 deletions

View File

@ -144,9 +144,9 @@ class EXTHRecord(object):
118 : 'retailprice', 118 : 'retailprice',
119 : 'retailpricecurrency', 119 : 'retailpricecurrency',
121 : 'KF8 header section index', 121 : 'KF8 header section index',
125 : 'KF8 unknown count', 125 : 'KF8 resources (images/fonts) count',
129 : 'KF8 thumbnail URI', 129 : 'KF8 cover URI',
131 : 'KF8 resources (images/fonts) count', 131 : 'KF8 unknown count',
201 : 'coveroffset', 201 : 'coveroffset',
202 : 'thumboffset', 202 : 'thumboffset',
203 : 'hasfakecover', 203 : 'hasfakecover',

View File

@ -29,9 +29,8 @@ EXTH_CODES = {
'versionnumber': 114, 'versionnumber': 114,
'startreading': 116, 'startreading': 116,
'kf8_header_index': 121, 'kf8_header_index': 121,
'kf8_unknown_count': 125, 'num_of_resources': 125,
'kf8_thumbnail_uri': 129, 'kf8_unknown_count': 131,
'num_of_resources': 131,
'coveroffset': 201, 'coveroffset': 201,
'thumboffset': 202, 'thumboffset': 202,
'hasfakecover': 203, 'hasfakecover': 203,
@ -160,10 +159,7 @@ def build_exth(metadata, prefer_author_sort=False, is_periodical=False,
if thumbnail_offset is not None: if thumbnail_offset is not None:
exth.write(pack(b'>III', EXTH_CODES['thumboffset'], 12, exth.write(pack(b'>III', EXTH_CODES['thumboffset'], 12,
thumbnail_offset)) thumbnail_offset))
cover_uri_str = bytes('kindle:embed:%04X' %(thumbnail_offset)) nrecs += 1
exth.write(pack(b'>II', EXTH_CODES['kf8_thumbnail_uri'], len(cover_uri_str) + 8))
exth.write(cover_uri_str)
nrecs += 2
if start_offset is not None: if start_offset is not None:
try: try: