Merge branch 'master' into Develop
This commit is contained in:
+6
-3
@@ -990,11 +990,14 @@ def _config_string(to_save, x):
|
||||
|
||||
|
||||
def _configuration_gdrive_helper(to_save):
|
||||
gdrive_error = None
|
||||
gdrive_secrets = {}
|
||||
|
||||
if not os.path.isfile(gdriveutils.SETTINGS_YAML):
|
||||
config.config_use_google_drive = False
|
||||
|
||||
gdrive_secrets = {}
|
||||
gdrive_error = gdriveutils.get_error_text(gdrive_secrets)
|
||||
if gdrive_support:
|
||||
gdrive_error = gdriveutils.get_error_text(gdrive_secrets)
|
||||
if "config_use_google_drive" in to_save and not config.config_use_google_drive and not gdrive_error:
|
||||
with open(gdriveutils.CLIENT_SECRETS, 'r') as settings:
|
||||
gdrive_secrets = json.load(settings)['web']
|
||||
@@ -1259,7 +1262,7 @@ def _configuration_result(error_flash=None, gdrive_error=None, configured=True):
|
||||
gdrivefolders = []
|
||||
if gdrive_error is None:
|
||||
gdrive_error = gdriveutils.get_error_text()
|
||||
if gdrive_error:
|
||||
if gdrive_error and gdrive_support:
|
||||
log.error(gdrive_error)
|
||||
gdrive_error = _(gdrive_error)
|
||||
else:
|
||||
|
||||
@@ -448,6 +448,9 @@ def edit_book_series_index(series_index, book):
|
||||
# Add default series_index to book
|
||||
modif_date = False
|
||||
series_index = series_index or '1'
|
||||
if not series_index.replace('.', '', 1).isdigit():
|
||||
flash(_("%(seriesindex)s is not a valid number, skipping", seriesindex=series_index), category="warning")
|
||||
return False
|
||||
if book.series_index != series_index:
|
||||
book.series_index = series_index
|
||||
modif_date = True
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ def get_fb2_info(tmp_file_path, original_file_extension):
|
||||
'l': 'http://www.w3.org/1999/xlink',
|
||||
}
|
||||
|
||||
fb2_file = open(tmp_file_path)
|
||||
fb2_file = open(tmp_file_path, encoding="utf-8")
|
||||
tree = etree.fromstring(fb2_file.read().encode())
|
||||
|
||||
authors = tree.xpath('/fb:FictionBook/fb:description/fb:title-info/fb:author', namespaces=ns)
|
||||
|
||||
+6
-3
@@ -122,9 +122,12 @@ def formatfloat(value, decimals=1):
|
||||
@jinjia.app_template_filter('formatseriesindex')
|
||||
def formatseriesindex_filter(series_index):
|
||||
if series_index:
|
||||
if int(series_index) - series_index == 0:
|
||||
return int(series_index)
|
||||
else:
|
||||
try:
|
||||
if int(series_index) - series_index == 0:
|
||||
return int(series_index)
|
||||
else:
|
||||
return series_index
|
||||
except ValueError:
|
||||
return series_index
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user