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

Implement split library and books

Bugfix arrows in comic reader
Fix kobo download link
Updated requirement
This commit is contained in:
Ozzie Isaacs
2023-11-07 19:30:13 +01:00
parent fad6550ff1
commit d68e57c4fc
16 changed files with 2428 additions and 1534 deletions

6
cps/web.py Executable file → Normal file
View File

@@ -1192,7 +1192,7 @@ def serve_book(book_id, book_format, anyname):
if book_format.upper() == 'TXT':
log.info('Serving book: %s', data.name)
try:
rawdata = open(os.path.join(config.config_calibre_dir, book.path, data.name + "." + book_format),
rawdata = open(os.path.join(config.get_book_path(), book.path, data.name + "." + book_format),
"rb").read()
result = chardet.detect(rawdata)
return make_response(
@@ -1202,7 +1202,7 @@ def serve_book(book_id, book_format, anyname):
return "File Not Found"
# enable byte range read of pdf
response = make_response(
send_from_directory(os.path.join(config.config_calibre_dir, book.path), data.name + "." + book_format))
send_from_directory(os.path.join(config.get_book_path(), book.path), data.name + "." + book_format))
if not range_header:
log.info('Serving book: %s', data.name)
response.headers['Accept-Ranges'] = 'bytes'
@@ -1226,7 +1226,7 @@ def send_to_ereader(book_id, book_format, convert):
response = [{'type': "danger", 'message': _("Please configure the SMTP mail settings first...")}]
return Response(json.dumps(response), mimetype='application/json')
elif current_user.kindle_mail:
result = send_mail(book_id, book_format, convert, current_user.kindle_mail, config.config_calibre_dir,
result = send_mail(book_id, book_format, convert, current_user.kindle_mail, config.get_book_path(),
current_user.name)
if result is None:
ub.update_download(book_id, int(current_user.id))