From 53c687251e87cd5b0e4c0998ed2d3da2f345e10d Mon Sep 17 00:00:00 2001 From: Jonathan Rehm Date: Wed, 16 Aug 2017 09:24:44 -0700 Subject: [PATCH] Show "More by" on author page Uses Goodread's list of author's books, filtering out the books that are already in the user's library. Requires the Goodreads dependency and API information. --- cps/static/img/goodreads.svg | 2 +- cps/templates/author.html | 2 +- cps/web.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cps/static/img/goodreads.svg b/cps/static/img/goodreads.svg index f89130e9..32695526 100644 --- a/cps/static/img/goodreads.svg +++ b/cps/static/img/goodreads.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/cps/templates/author.html b/cps/templates/author.html index 224244bc..59458824 100644 --- a/cps/templates/author.html +++ b/cps/templates/author.html @@ -64,7 +64,7 @@ -{% if other_books is not none %} +{% if other_books %}

{{_("More by")}} {{ author.name|safe }}

diff --git a/cps/web.py b/cps/web.py index f5cac135..2dbf1736 100755 --- a/cps/web.py +++ b/cps/web.py @@ -1134,7 +1134,7 @@ def author(book_id, page): name = db.session.query(db.Authors).filter(db.Authors.id == book_id).first().name author_info = None - other_books = None + other_books = [] if goodreads_support and config.config_use_goodreads: gc = GoodreadsClient(config.config_goodreads_api_key, config.config_goodreads_api_secret) author_info = gc.find_author(author_name=name)