Ignore 'Unknown' author when downloading metadata. Fixes #779348 (metadata fails on unknown author)

This commit is contained in:
Kovid Goyal 2011-05-08 17:37:46 -06:00
parent 71d5864373
commit a558cd0d2a
2 changed files with 3 additions and 3 deletions

View File

@ -338,7 +338,7 @@ class Amazon(Source):
q['field-author'] = ' '.join(author_tokens) q['field-author'] = ' '.join(author_tokens)
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 and 'field-author' in q)): ('field-title' in q)):
# Insufficient metadata to make an identify query # Insufficient metadata to make an identify query
return None return None

View File

@ -291,10 +291,10 @@ class Source(Plugin):
parts = parts[1:] + parts[:1] parts = parts[1:] + parts[:1]
for tok in parts: for tok in parts:
tok = remove_pat.sub('', tok).strip() tok = remove_pat.sub('', tok).strip()
if len(tok) > 2 and tok.lower() not in ('von', ): if len(tok) > 2 and tok.lower() not in ('von', 'van',
_('Unknown').lower()):
yield tok yield tok
def get_title_tokens(self, title, strip_joiners=True, strip_subtitle=False): def get_title_tokens(self, title, strip_joiners=True, strip_subtitle=False):
''' '''
Take a title and return a list of tokens useful for an AND search query. Take a title and return a list of tokens useful for an AND search query.