fetch-ebook-metadata: Fix an error when using the --cover option and no cover is found. Fixes #1938189 [fetch-ebook-metadata sometimes fails with -c switch](https://bugs.launchpad.net/calibre/+bug/1938189)

This commit is contained in:
Kovid Goyal 2021-07-27 21:35:25 +05:30
parent 4c168fd409
commit c3aed85cbf
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -90,7 +90,8 @@ def main(args=sys.argv):
if opts.cover and results: if opts.cover and results:
cover = download_cover(log, title=opts.title, authors=authors, cover = download_cover(log, title=opts.title, authors=authors,
identifiers=result.identifiers, timeout=int(opts.timeout)) identifiers=result.identifiers, timeout=int(opts.timeout))
if cover is None and not opts.opf: if cover is None:
if not opts.opf:
prints('No cover found', file=sys.stderr) prints('No cover found', file=sys.stderr)
else: else:
save_cover_data_to(cover[-1], opts.cover) save_cover_data_to(cover[-1], opts.cover)