|
|
@ -26,6 +26,7 @@ from .helper import split_authors
|
|
|
|
from .constants import BookMeta
|
|
|
|
from .constants import BookMeta
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def extractCover(zipFile, coverFile, coverpath, tmp_file_name):
|
|
|
|
def extractCover(zipFile, coverFile, coverpath, tmp_file_name):
|
|
|
|
if coverFile is None:
|
|
|
|
if coverFile is None:
|
|
|
|
return None
|
|
|
|
return None
|
|
|
@ -83,16 +84,8 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
epub_metadata['description'] = ""
|
|
|
|
epub_metadata['description'] = ""
|
|
|
|
|
|
|
|
|
|
|
|
if epub_metadata['language'] == u'Unknown':
|
|
|
|
lang = epub_metadata['language'].split('-', 1)[0].lower()
|
|
|
|
epub_metadata['language'] = ""
|
|
|
|
epub_metadata['language'] = isoLanguages.get_lang3(lang)
|
|
|
|
else:
|
|
|
|
|
|
|
|
lang = epub_metadata['language'].split('-', 1)[0].lower()
|
|
|
|
|
|
|
|
if len(lang) == 2:
|
|
|
|
|
|
|
|
epub_metadata['language'] = isoLanguages.get(part1=lang).name
|
|
|
|
|
|
|
|
elif len(lang) == 3:
|
|
|
|
|
|
|
|
epub_metadata['language'] = isoLanguages.get(part3=lang).name
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
epub_metadata['language'] = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
series = tree.xpath("/pkg:package/pkg:metadata/pkg:meta[@name='calibre:series']/@content", namespaces=ns)
|
|
|
|
series = tree.xpath("/pkg:package/pkg:metadata/pkg:meta[@name='calibre:series']/@content", namespaces=ns)
|
|
|
|
if len(series) > 0:
|
|
|
|
if len(series) > 0:
|
|
|
|