mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
RB Input: Do not generate empty title tag
This commit is contained in:
parent
08c840cba3
commit
abdb32e1a7
@ -65,7 +65,7 @@ class Reader(object):
|
|||||||
name = urlunquote(self.stream.read(32).strip('\x00'))
|
name = urlunquote(self.stream.read(32).strip('\x00'))
|
||||||
size, offset, flags = self.read_i32(), self.read_i32(), self.read_i32()
|
size, offset, flags = self.read_i32(), self.read_i32(), self.read_i32()
|
||||||
toc.append(RBToc.Item(name=name, size=size, offset=offset, flags=flags))
|
toc.append(RBToc.Item(name=name, size=size, offset=offset, flags=flags))
|
||||||
|
|
||||||
return toc
|
return toc
|
||||||
|
|
||||||
def get_text(self, toc_item, output_dir):
|
def get_text(self, toc_item, output_dir):
|
||||||
@ -89,7 +89,7 @@ class Reader(object):
|
|||||||
output += self.stream.read(toc_item.size).decode('cp1252' if self.encoding is None else self.encoding, 'replace')
|
output += self.stream.read(toc_item.size).decode('cp1252' if self.encoding is None else self.encoding, 'replace')
|
||||||
|
|
||||||
with open(os.path.join(output_dir, toc_item.name), 'wb') as html:
|
with open(os.path.join(output_dir, toc_item.name), 'wb') as html:
|
||||||
html.write(output.encode('utf-8'))
|
html.write(output.replace('<TITLE>', '<TITLE> ').encode('utf-8'))
|
||||||
|
|
||||||
def get_image(self, toc_item, output_dir):
|
def get_image(self, toc_item, output_dir):
|
||||||
if toc_item.flags != 0:
|
if toc_item.flags != 0:
|
||||||
@ -105,7 +105,7 @@ class Reader(object):
|
|||||||
self.log.debug('Extracting content from file...')
|
self.log.debug('Extracting content from file...')
|
||||||
html = []
|
html = []
|
||||||
images = []
|
images = []
|
||||||
|
|
||||||
for item in self.toc:
|
for item in self.toc:
|
||||||
if item.name.lower().endswith('html'):
|
if item.name.lower().endswith('html'):
|
||||||
self.log.debug('HTML item %s found...' % item.name)
|
self.log.debug('HTML item %s found...' % item.name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user