1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-12 14:17:40 +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]