mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-24 18:47:23 +00:00
Update web.py
This commit is contained in:
parent
cf9a7d538f
commit
3f72c3fffe
@ -1159,7 +1159,14 @@ def serve_book(book_id, book_format, anyname):
|
||||
data = calibre_db.get_book_format(book_id, book_format.upper())
|
||||
if not data:
|
||||
return "File not in Database"
|
||||
log.info('Serving book: %s', data.name)
|
||||
|
||||
range_header = request.headers.get('Range', None)
|
||||
if not range_header:
|
||||
log.info('Serving book: %s', data.name)
|
||||
response = make_response(send_from_directory(os.path.join(config.config_calibre_dir, book.path), data.name + "." + book_format))
|
||||
response.headers['Accept-Ranges'] = 'bytes'
|
||||
return response
|
||||
|
||||
if config.config_use_google_drive:
|
||||
try:
|
||||
headers = Headers()
|
||||
|
Loading…
Reference in New Issue
Block a user