Stricter test for author match from edelweiss.com

This commit is contained in:
Kovid Goyal 2014-02-02 10:15:36 +05:30
parent b3b6337b29
commit 1f1c75d645

View File

@ -283,8 +283,11 @@ class Edelweiss(Source):
# edelweiss returns matches based only on title, so we # edelweiss returns matches based only on title, so we
# filter by author manually # filter by author manually
div = CSSSelect('div.contributor.attGroup')(entry) div = CSSSelect('div.contributor.attGroup')(entry)
entry_authors = set(self.get_author_tokens([x.strip() for x in astext(div[0]).lower().split(',')])) try:
if not entry_authors.intersection(author_tokens): entry_authors = set(self.get_author_tokens([x.strip() for x in astext(div[0]).lower().split(',')]))
except IndexError:
entry_authors = set()
if not entry_authors.issuperset(author_tokens):
continue continue
entries.append((self._get_book_url(sku), sku)) entries.append((self._get_book_url(sku), sku))