diff --git a/Book Library/app/models/books.py b/Book Library/app/models/books.py index 33b9d37..cde2922 100644 --- a/Book Library/app/models/books.py +++ b/Book Library/app/models/books.py @@ -4,12 +4,8 @@ class Books(): def __init__(self, query="", start=0, testing=False, https=False): - if not testing: - self.json = google_book_search(query, start) - else: - self.json = testing - - self.https = True if https else False + self.json = google_book_search(query, start) if not testing else testing + self.https = bool(https) def parse(self): """ @@ -56,12 +52,11 @@ def _parse_thumbnail(self, imageLinks=""): """ if not imageLinks: return {"thumbnail": "static/images/booky-book.jpg"} - else: - if self.https: - for link in imageLinks: - imageLinks[link] = convert_to_https(imageLinks[link]) + if self.https: + for link in imageLinks: + imageLinks[link] = convert_to_https(imageLinks[link]) - return imageLinks + return imageLinks def payload(items, total):