mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-28 12:30:00 +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())
|
data = calibre_db.get_book_format(book_id, book_format.upper())
|
||||||
if not data:
|
if not data:
|
||||||
return "File not in Database"
|
return "File not in Database"
|
||||||
|
|
||||||
|
range_header = request.headers.get('Range', None)
|
||||||
|
if not range_header:
|
||||||
log.info('Serving book: %s', data.name)
|
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:
|
if config.config_use_google_drive:
|
||||||
try:
|
try:
|
||||||
headers = Headers()
|
headers = Headers()
|
||||||
|
Loading…
Reference in New Issue
Block a user