Expand matching books on keys like isbn
This commit is contained in:
@ -34,17 +34,20 @@ class Connector(AbstractConnector):
|
||||
search_results = []
|
||||
for book in results[:10]:
|
||||
search_results.append(
|
||||
SearchResult(
|
||||
book.title,
|
||||
book.id,
|
||||
book.author_text,
|
||||
book.published_date.year if book.published_date else None,
|
||||
None
|
||||
)
|
||||
self.format_search_result(book)
|
||||
)
|
||||
return search_results
|
||||
|
||||
|
||||
def format_search_result(self, book):
|
||||
return SearchResult(
|
||||
book.title,
|
||||
book.id,
|
||||
book.author_text,
|
||||
book.published_date.year if book.published_date else None,
|
||||
)
|
||||
|
||||
|
||||
def get_or_create_book(self, book_id):
|
||||
''' since this is querying its own data source, it can only
|
||||
get a book, not load one from an external source '''
|
||||
|
Reference in New Issue
Block a user