Allowing upload extensions (#1119)
This commit is contained in:
parent
51f12c51ad
commit
75fb7c2e95
|
@ -542,7 +542,7 @@ def _configuration_oauth_helper(to_save):
|
||||||
"oauth_client_secret": to_save["config_" + str(element['id']) + "_oauth_client_secret"],
|
"oauth_client_secret": to_save["config_" + str(element['id']) + "_oauth_client_secret"],
|
||||||
"active": element["active"]})
|
"active": element["active"]})
|
||||||
|
|
||||||
def _configuration_logfile_helper(gdriveError, to_save):
|
def _configuration_logfile_helper(to_save, gdriveError):
|
||||||
reboot_required = False
|
reboot_required = False
|
||||||
reboot_required |= _config_int(to_save, "config_log_level")
|
reboot_required |= _config_int(to_save, "config_log_level")
|
||||||
reboot_required |= _config_string(to_save, "config_logfile")
|
reboot_required |= _config_string(to_save, "config_logfile")
|
||||||
|
@ -615,13 +615,11 @@ def _configuration_update_helper():
|
||||||
db_change = False
|
db_change = False
|
||||||
to_save = request.form.to_dict()
|
to_save = request.form.to_dict()
|
||||||
|
|
||||||
|
|
||||||
db_change |= _config_string(to_save, "config_calibre_dir")
|
db_change |= _config_string(to_save, "config_calibre_dir")
|
||||||
|
|
||||||
# Google drive setup
|
# Google drive setup
|
||||||
gdriveError = _configuration_gdrive_helper(to_save)
|
gdriveError = _configuration_gdrive_helper(to_save)
|
||||||
|
|
||||||
|
|
||||||
reboot_required |= _config_int(to_save, "config_port")
|
reboot_required |= _config_int(to_save, "config_port")
|
||||||
|
|
||||||
reboot_required |= _config_string(to_save, "config_keyfile")
|
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")
|
reboot_required |= _config_checkbox_int(to_save, "config_kobo_sync")
|
||||||
_config_checkbox_int(to_save, "config_kobo_proxy")
|
_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_calibre")
|
||||||
_config_string(to_save, "config_converterpath")
|
_config_string(to_save, "config_converterpath")
|
||||||
_config_string(to_save, "config_kepubifypath")
|
_config_string(to_save, "config_kepubifypath")
|
||||||
|
|
|
@ -291,7 +291,7 @@ class _ConfigSQL(object):
|
||||||
db_file = os.path.join(self.config_calibre_dir, 'metadata.db')
|
db_file = os.path.join(self.config_calibre_dir, 'metadata.db')
|
||||||
have_metadata_db = os.path.isfile(db_file)
|
have_metadata_db = os.path.isfile(db_file)
|
||||||
self.db_configured = have_metadata_db
|
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)
|
logger.setup(self.config_logfile, self.config_log_level)
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
|
|
|
@ -1241,6 +1241,8 @@ def serve_book(book_id, book_format, anyname):
|
||||||
def download_link(book_id, book_format, anyname):
|
def download_link(book_id, book_format, anyname):
|
||||||
if "Kobo" in request.headers.get('User-Agent'):
|
if "Kobo" in request.headers.get('User-Agent'):
|
||||||
client = "kobo"
|
client = "kobo"
|
||||||
|
else:
|
||||||
|
client=""
|
||||||
|
|
||||||
return get_download_link(book_id, book_format, client)
|
return get_download_link(book_id, book_format, client)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user