mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Don't die if generating default masthead fails
This commit is contained in:
parent
5fb1d6ab82
commit
845e558ae0
@ -770,7 +770,11 @@ class BasicNewsRecipe(Recipe):
|
|||||||
self.download_masthead(murl)
|
self.download_masthead(murl)
|
||||||
if self.masthead_path is None:
|
if self.masthead_path is None:
|
||||||
self.masthead_path = os.path.join(self.output_dir, 'mastheadImage.jpg')
|
self.masthead_path = os.path.join(self.output_dir, 'mastheadImage.jpg')
|
||||||
self.default_masthead_image(self.masthead_path)
|
try:
|
||||||
|
self.default_masthead_image(self.masthead_path)
|
||||||
|
except:
|
||||||
|
self.log.exception('Failed to generate default masthead image')
|
||||||
|
self.masthead_path = None
|
||||||
|
|
||||||
if self.test:
|
if self.test:
|
||||||
feeds = feeds[:2]
|
feeds = feeds[:2]
|
||||||
@ -1061,7 +1065,7 @@ class BasicNewsRecipe(Recipe):
|
|||||||
opf = OPFCreator(dir, mi)
|
opf = OPFCreator(dir, mi)
|
||||||
# Add mastheadImage entry to <guide> section
|
# Add mastheadImage entry to <guide> section
|
||||||
mp = getattr(self, 'masthead_path', None)
|
mp = getattr(self, 'masthead_path', None)
|
||||||
if mp is not None:
|
if mp is not None and os.access(mp, os.R_OK):
|
||||||
from calibre.ebooks.metadata.opf2 import Guide
|
from calibre.ebooks.metadata.opf2 import Guide
|
||||||
ref = Guide.Reference(os.path.basename(self.masthead_path), os.getcwdu())
|
ref = Guide.Reference(os.path.basename(self.masthead_path), os.getcwdu())
|
||||||
ref.type = 'masthead'
|
ref.type = 'masthead'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user