1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-11-28 04:19:59 +00:00

Implement gdrive metadata on download

This commit is contained in:
Ozzie Isaacs 2023-11-11 15:26:05 +01:00
parent cf6810db87
commit 7fd1d10fca
2 changed files with 6 additions and 5 deletions

View File

@ -942,10 +942,12 @@ def do_download_file(book, book_format, client, data, headers):
df = gd.getFileFromEbooksFolder(book.path, book_name + "." + book_format)
# log.debug('%s', time.time() - startTime)
if df:
# ToDo check:!!!!!!!!
if config.config_binariesdir:
output = os.path.join(config.config_calibre_dir, book.path, data.name)
gd.ownloadFile(book.path, book_name + "." + book_format, output)
output_path = os.path.join(config.config_calibre_dir, book.path)
if not os.path.exists(output_path):
os.makedirs(output_path)
output = os.path.join(config.config_calibre_dir, book.path, book_name + "." + book_format)
gd.downloadFile(book.path, book_name + "." + book_format, output)
filename, download_name = do_calibre_export(book, book_format)
else:
return gd.do_gdrive_download(df, headers)
@ -973,7 +975,6 @@ def do_download_file(book, book_format, client, data, headers):
return response
def do_calibre_export(book, book_format):
try:
quotes = [3, 5, 7, 9]

View File

@ -31,7 +31,7 @@ from flask_babel import format_datetime
from flask_babel import gettext as _
from . import constants, logger # config, web_server
from .file_helper import gettempdir
from .file_helper import get_temp_dir
log = logger.create()