Skip to content

Commit

Permalink
No longer modify header field 504
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Aug 4, 2019
1 parent 4c13ef0 commit 5f5157c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions kindlecomicconverter/dualmetafix.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,12 @@ def __init__(self, infile, outfile, asin):
self.datain_rec0 = readsection(self.datain, 0)

# in the first mobi header
# add 501 to "EBOK", add 113 as asin, add 504 as asin
# add 501 to "EBOK", add 113 as asin
rec0 = self.datain_rec0
rec0 = del_exth(rec0, 501)
rec0 = del_exth(rec0, 113)
rec0 = del_exth(rec0, 504)
rec0 = add_exth(rec0, 501, b'EBOK')
rec0 = add_exth(rec0, 113, asin)
rec0 = add_exth(rec0, 504, asin)
replacesection(self.datain, 0, rec0)

ver = getint(self.datain_rec0, mobi_version)
Expand All @@ -172,14 +170,12 @@ def __init__(self, infile, outfile, asin):
self.datain_kfrec0 = readsection(self.datain, datain_kf8)

# in the second header
# add 501 to "EBOK", add 113 as asin, add 504 as asin
# add 501 to "EBOK", add 113 as asin
rec0 = self.datain_kfrec0
rec0 = del_exth(rec0, 501)
rec0 = del_exth(rec0, 113)
rec0 = del_exth(rec0, 504)
rec0 = add_exth(rec0, 501, b'EBOK')
rec0 = add_exth(rec0, 113, asin)
rec0 = add_exth(rec0, 504, asin)
replacesection(self.datain, datain_kf8, rec0)

self.datain.flush()
Expand Down

0 comments on commit 5f5157c

Please sign in to comment.