better error message when insufficient metadata is supplied for amazon plugin

This commit is contained in:
Kovid Goyal 2022-11-27 10:22:31 +05:30
parent 89682efc85
commit fc14d0df1f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1031,7 +1031,7 @@ class Worker(Thread): # Get details {{{
class Amazon(Source):
name = 'Amazon.com'
version = (1, 3, 2)
version = (1, 3, 3)
minimum_calibre_version = (2, 82, 0)
description = _('Downloads metadata and covers from Amazon')
@ -1321,7 +1321,8 @@ class Amazon(Source):
if not ('field-keywords' in q or 'field-isbn' in q or
('field-title' in q)):
# Insufficient metadata to make an identify query
return None, None
log.error('Insufficient metadata to construct query, none of title, ISBN or ASIN supplied')
raise SearchFailed()
if not for_amazon:
return terms, domain
@ -1445,9 +1446,6 @@ class Amazon(Source):
matches = []
query, domain = self.create_query(log, title=title, authors=authors,
identifiers=identifiers)
if query is None:
log.error('Insufficient metadata to construct query')
raise SearchFailed()
try:
raw = br.open_novisit(query, timeout=timeout).read().strip()
except Exception as e: