1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-14 23:27:39 +00:00

log file name in case of filename not found (#691)

This commit is contained in:
Ozzieisaacs
2018-11-03 18:37:38 +01:00
parent 8d6d28eb57
commit 399dffba5a
2 changed files with 11 additions and 14 deletions

View File

@@ -377,7 +377,11 @@ def do_download_file(book, book_format, data, headers):
else:
abort(404)
else:
response = make_response(send_from_directory(os.path.join(ub.config.config_calibre_dir, book.path), data.name + "." + book_format))
filename = os.path.join(ub.config.config_calibre_dir, book.path)
if not os.path.isfile(os.path.join(filename, data.name + "." + book_format)):
# ToDo: improve error handling
web.app.logger.error('File not found: %s' % os.path.join(filename, data.name + "." + book_format))
response = make_response(send_from_directory(filename, data.name + "." + book_format))
response.headers = headers
return response