Generator erroneously used as list

This commit is contained in:
Kovid Goyal 2017-03-18 09:02:32 +05:30
parent e3edc50f77
commit 8433f1d7a8
3 changed files with 5 additions and 5 deletions

View File

@ -1072,8 +1072,8 @@ class Amazon(Source):
q['field-title'] = ' '.join(title_tokens)
terms.extend(title_tokens)
if authors:
author_tokens = self.get_author_tokens(authors,
only_first_author=True)
author_tokens = list(self.get_author_tokens(authors,
only_first_author=True))
if author_tokens:
q['field-author'] = ' '.join(author_tokens)
terms.extend(author_tokens)

View File

@ -196,8 +196,8 @@ class Douban(Source):
title_tokens = list(self.get_title_tokens(title))
if title_tokens:
q += build_term('title', title_tokens)
author_tokens = self.get_author_tokens(authors,
only_first_author=True)
author_tokens = list(self.get_author_tokens(authors,
only_first_author=True))
if author_tokens:
q += ((' ' if q != '' else '') +
build_term('author', author_tokens))

View File

@ -210,7 +210,7 @@ class GoogleBooks(Source):
title_tokens = list(self.get_title_tokens(title))
if title_tokens:
q += build_term('title', title_tokens)
author_tokens = self.get_author_tokens(authors, only_first_author=True)
author_tokens = list(self.get_author_tokens(authors, only_first_author=True))
if author_tokens:
q += ('+' if q else '') + build_term('author', author_tokens)