This commit is contained in:
j 2019-02-01 16:43:20 +05:30
parent 853f6cdc0c
commit 1421e402e1

View file

@ -153,7 +153,7 @@ def info(epub):
contents.append(txt) contents.append(txt)
if contents: if contents:
data['tableofcontents'] = '\n'.join(contents).strip() data['tableofcontents'] = '\n'.join(contents).strip()
if not 'tableofcontents' in data: if 'tableofcontents' not in data:
guide = info.find('{http://www.idpf.org/2007/opf}guide') guide = info.find('{http://www.idpf.org/2007/opf}guide')
if guide: if guide:
for ref in guide.findall('{http://www.idpf.org/2007/opf}reference'): for ref in guide.findall('{http://www.idpf.org/2007/opf}reference'):
@ -169,7 +169,7 @@ def info(epub):
data['description'] = strip_tags(decode_html(data['description'])) data['description'] = strip_tags(decode_html(data['description']))
text = extract_text(epub) text = extract_text(epub)
data['textsize'] = len(text) data['textsize'] = len(text)
if not 'isbn' in data: if 'isbn' not in data:
isbn = extract_isbn(text) isbn = extract_isbn(text)
if isbn: if isbn:
data['isbn'] = isbn data['isbn'] = isbn