mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Put in some more fallbacks for when a chosen parser failes.
This commit is contained in:
parent
6ea252106e
commit
189cbd41fe
@ -66,6 +66,8 @@ class APNXBuilder(object):
|
|||||||
pages = self.get_pages_accurate(mobi_file_path)
|
pages = self.get_pages_accurate(mobi_file_path)
|
||||||
elif method == 'pagebreak':
|
elif method == 'pagebreak':
|
||||||
pages = self.get_pages_pagebreak_tag(mobi_file_path)
|
pages = self.get_pages_pagebreak_tag(mobi_file_path)
|
||||||
|
if not pages:
|
||||||
|
pages = self.get_pages_accurate(mobi_file_path)
|
||||||
else:
|
else:
|
||||||
raise('no valid accurate method chosen use fast')
|
raise('no valid accurate method chosen use fast')
|
||||||
except:
|
except:
|
||||||
@ -74,6 +76,8 @@ class APNXBuilder(object):
|
|||||||
# due to the file having DRM.
|
# due to the file having DRM.
|
||||||
pages = self.get_pages_fast(mobi_file_path)
|
pages = self.get_pages_fast(mobi_file_path)
|
||||||
|
|
||||||
|
if not pages:
|
||||||
|
pages = self.get_pages_fast(mobi_file_path)
|
||||||
if not pages:
|
if not pages:
|
||||||
raise Exception(_('Could not generate page mapping.'))
|
raise Exception(_('Could not generate page mapping.'))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user