mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
MOBI output: Write the correct value for record UID field in the palmdb header
This commit is contained in:
parent
80e7b3e52e
commit
ee1fdd3d0c
@ -1634,7 +1634,7 @@ class MobiWriter(object):
|
||||
now = int(time.time())
|
||||
nrecords = len(self._records)
|
||||
self._write(title, pack('>HHIIIIII', 0, 0, now, now, 0, 0, 0, 0),
|
||||
'BOOK', 'MOBI', pack('>IIH', nrecords, 0, nrecords))
|
||||
'BOOK', 'MOBI', pack('>IIH', (2*nrecords)-1, 0, nrecords))
|
||||
offset = self._tell() + (8 * nrecords) + 2
|
||||
for i, record in enumerate(self._records):
|
||||
self._write(pack('>I', offset), '\0', pack('>I', 2*i)[1:])
|
||||
|
@ -550,7 +550,7 @@ class MobiWriter(object):
|
||||
now = int(time.time())
|
||||
nrecords = len(self.records)
|
||||
self.write(title, pack(b'>HHIIIIII', 0, 0, now, now, 0, 0, 0, 0),
|
||||
b'BOOK', b'MOBI', pack(b'>IIH', nrecords, 0, nrecords))
|
||||
b'BOOK', b'MOBI', pack(b'>IIH', (2*nrecords)-1, 0, nrecords))
|
||||
offset = self.tell() + (8 * nrecords) + 2
|
||||
for i, record in enumerate(self.records):
|
||||
self.write(pack(b'>I', offset), b'\0', pack(b'>I', 2*i)[1:])
|
||||
|
Loading…
x
Reference in New Issue
Block a user