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
+9 -10
View File
@@ -355,7 +355,9 @@ def HandleMetadataRequest(book_uuid):
return redirect_or_proxy_request()
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):
@@ -413,15 +415,12 @@ def get_description(book):
def get_author(book):
if not book.authors:
return {"Contributors": None}
if len(book.authors) > 1:
author_list = []
autor_roles = []
for author in book.authors:
autor_roles.append({"Name":author.name}) #.encode('unicode-escape').decode('latin-1')
author_list.append(author.name)
return {"ContributorRoles": autor_roles, "Contributors":author_list}
return {"ContributorRoles": [{"Name":book.authors[0].name}],
"Contributors": book.authors[0].name}
author_list = []
autor_roles = []
for author in book.authors:
autor_roles.append({"Name":author.name}) #.encode('unicode-escape').decode('latin-1')
author_list.append(author.name)
return {"ContributorRoles": autor_roles, "Contributors":author_list}
def get_publisher(book):