1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-11-24 18:47:23 +00:00

Allowing upload extensions (#1119)

This commit is contained in:
Ozzieisaacs 2020-05-09 16:54:22 +02:00
parent 51f12c51ad
commit 75fb7c2e95
3 changed files with 7 additions and 4 deletions

View File

@ -542,7 +542,7 @@ def _configuration_oauth_helper(to_save):
"oauth_client_secret": to_save["config_" + str(element['id']) + "_oauth_client_secret"],
"active": element["active"]})
def _configuration_logfile_helper(gdriveError, to_save):
def _configuration_logfile_helper(to_save, gdriveError):
reboot_required = False
reboot_required |= _config_int(to_save, "config_log_level")
reboot_required |= _config_string(to_save, "config_logfile")
@ -615,13 +615,11 @@ def _configuration_update_helper():
db_change = False
to_save = request.form.to_dict()
db_change |= _config_string(to_save, "config_calibre_dir")
# Google drive setup
gdriveError = _configuration_gdrive_helper(to_save)
reboot_required |= _config_int(to_save, "config_port")
reboot_required |= _config_string(to_save, "config_keyfile")
@ -638,6 +636,9 @@ def _configuration_update_helper():
reboot_required |= _config_checkbox_int(to_save, "config_kobo_sync")
_config_checkbox_int(to_save, "config_kobo_proxy")
_config_string(to_save, "config_upload_formats")
constants.EXTENSIONS_UPLOAD = [x.lstrip().rstrip() for x in config.config_upload_formats.split(',')]
_config_string(to_save, "config_calibre")
_config_string(to_save, "config_converterpath")
_config_string(to_save, "config_kepubifypath")

View File

@ -291,7 +291,7 @@ class _ConfigSQL(object):
db_file = os.path.join(self.config_calibre_dir, 'metadata.db')
have_metadata_db = os.path.isfile(db_file)
self.db_configured = have_metadata_db
constants.EXTENSIONS_UPLOAD = [x.lstrip().rstrip() for x in self.config_upload_formats.split(',')]
logger.setup(self.config_logfile, self.config_log_level)
def save(self):

View File

@ -1241,6 +1241,8 @@ def serve_book(book_id, book_format, anyname):
def download_link(book_id, book_format, anyname):
if "Kobo" in request.headers.get('User-Agent'):
client = "kobo"
else:
client=""
return get_download_link(book_id, book_format, client)