mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
better error message when insufficient metadata is supplied for amazon plugin
This commit is contained in:
parent
89682efc85
commit
fc14d0df1f
@ -1031,7 +1031,7 @@ class Worker(Thread): # Get details {{{
|
|||||||
class Amazon(Source):
|
class Amazon(Source):
|
||||||
|
|
||||||
name = 'Amazon.com'
|
name = 'Amazon.com'
|
||||||
version = (1, 3, 2)
|
version = (1, 3, 3)
|
||||||
minimum_calibre_version = (2, 82, 0)
|
minimum_calibre_version = (2, 82, 0)
|
||||||
description = _('Downloads metadata and covers from Amazon')
|
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
|
if not ('field-keywords' in q or 'field-isbn' in q or
|
||||||
('field-title' in q)):
|
('field-title' in q)):
|
||||||
# Insufficient metadata to make an identify query
|
# 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:
|
if not for_amazon:
|
||||||
return terms, domain
|
return terms, domain
|
||||||
@ -1445,9 +1446,6 @@ class Amazon(Source):
|
|||||||
matches = []
|
matches = []
|
||||||
query, domain = self.create_query(log, title=title, authors=authors,
|
query, domain = self.create_query(log, title=title, authors=authors,
|
||||||
identifiers=identifiers)
|
identifiers=identifiers)
|
||||||
if query is None:
|
|
||||||
log.error('Insufficient metadata to construct query')
|
|
||||||
raise SearchFailed()
|
|
||||||
try:
|
try:
|
||||||
raw = br.open_novisit(query, timeout=timeout).read().strip()
|
raw = br.open_novisit(query, timeout=timeout).read().strip()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user