Allow download of archived books

This commit is contained in:
Ozzie Isaacs 2021-12-04 11:16:33 +01:00
parent f4096b136e
commit 91a21ababe
3 changed files with 12 additions and 14 deletions

View File

@ -823,7 +823,7 @@ def get_cc_columns(filter_config_custom_read=False):
def get_download_link(book_id, book_format, client): def get_download_link(book_id, book_format, client):
book_format = book_format.split(".")[0] book_format = book_format.split(".")[0]
book = calibre_db.get_filtered_book(book_id) book = calibre_db.get_filtered_book(book_id, allow_show_archived=True)
if book: if book:
data1 = calibre_db.get_book_format(book.id, book_format.upper()) data1 = calibre_db.get_book_format(book.id, book_format.upper())
else: else:

View File

@ -355,7 +355,9 @@ def HandleMetadataRequest(book_uuid):
return redirect_or_proxy_request() return redirect_or_proxy_request()
metadata = get_metadata(book) metadata = get_metadata(book)
return jsonify([metadata]) response = make_response(json.dumps([metadata]))
response.headers["Content-Type"] = "application/json; charset=utf-8"
return response
def get_download_url_for_book(book, book_format): def get_download_url_for_book(book, book_format):
@ -413,15 +415,12 @@ def get_description(book):
def get_author(book): def get_author(book):
if not book.authors: if not book.authors:
return {"Contributors": None} return {"Contributors": None}
if len(book.authors) > 1: author_list = []
author_list = [] autor_roles = []
autor_roles = [] for author in book.authors:
for author in book.authors: autor_roles.append({"Name":author.name}) #.encode('unicode-escape').decode('latin-1')
autor_roles.append({"Name":author.name}) #.encode('unicode-escape').decode('latin-1') author_list.append(author.name)
author_list.append(author.name) return {"ContributorRoles": autor_roles, "Contributors":author_list}
return {"ContributorRoles": autor_roles, "Contributors":author_list}
return {"ContributorRoles": [{"Name":book.authors[0].name}],
"Contributors": book.authors[0].name}
def get_publisher(book): def get_publisher(book):

View File

@ -182,10 +182,9 @@ class SyncToken:
return b64encode_json(token) return b64encode_json(token)
def __str__(self): def __str__(self):
return "{},{},{},{},{},{}".format(self.raw_kobo_store_token, return "{},{},{},{},{},{}".format(self.books_last_created,
self.books_last_created,
self.books_last_modified, self.books_last_modified,
self.archive_last_modified, self.archive_last_modified,
self.reading_state_last_modified, self.reading_state_last_modified,
self.tags_last_modified) self.tags_last_modified, self.raw_kobo_store_token)
#self.books_last_id) #self.books_last_id)