1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-17 16:47:39 +00:00

Improvements

This commit is contained in:
Ozzieisaacs
2020-05-09 10:58:59 +02:00
parent ff75bdba9e
commit 0a02caad04
9 changed files with 36 additions and 49 deletions

View File

@@ -609,14 +609,8 @@ def do_download_file(book, book_format, client, data, headers):
# ToDo: improve error handling
log.error('File not found: %s', os.path.join(filename, data.name + "." + book_format))
if client == "kobo" and book_format == "epub":
filename = config.config_kepub_cache_dir
os.system('{0} "{1}" -o {2}'.format(
config.config_kepubify_path,
os.path.join(filename, data.name + "." + book_format),
filename))
book_format = "kepub.epub"
headers["Content-Disposition"] = headers["Content-Disposition"].replace(".epub", ".kepub.epub")
if client == "kobo" and book_format == "kepub":
headers["Content-Disposition"] = headers["Content-Disposition"].replace(".kepub", ".kepub.epub")
response = make_response(send_from_directory(filename, data.name + "." + book_format))