Commit a62fca1e authored by Ozzie Isaacs's avatar Ozzie Isaacs

Merge branch 'master' into Develop

parents 010c0bfc 7b1d23eb
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
Calibre-Web is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing [Calibre](https://calibre-ebook.com) database. Calibre-Web is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing [Calibre](https://calibre-ebook.com) database.
![GitHub License](https://img.shields.io/github/license/janeczku/calibre-web) ![GitHub Downloads](https://img.shields.io/github/downloads/janeczku/calibre-web/total) ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/janeczku/calibre-web?logo=github) [![Discord](https://img.shields.io/discord/838810113564344381?label=Discord&logo=discord)](https://discord.gg/h2VsJ2NEfB)
*This software is a fork of [library](https://github.com/mutschler/calibreserver) and licensed under the GPL v3 License.* *This software is a fork of [library](https://github.com/mutschler/calibreserver) and licensed under the GPL v3 License.*
![Main screen](https://github.com/janeczku/calibre-web/wiki/images/main_screen.png) ![Main screen](https://github.com/janeczku/calibre-web/wiki/images/main_screen.png)
...@@ -80,7 +82,9 @@ Pre-built Docker images are available in these Docker Hub repositories: ...@@ -80,7 +82,9 @@ Pre-built Docker images are available in these Docker Hub repositories:
+ The "path to convertertool" should be set to `/usr/bin/ebook-convert` + The "path to convertertool" should be set to `/usr/bin/ebook-convert`
+ The "path to unrar" should be set to `/usr/bin/unrar` + The "path to unrar" should be set to `/usr/bin/unrar`
# Wiki # Contact
Just reach us out on [Discord](https://discord.gg/h2VsJ2NEfB)
For further information, How To's and FAQ please check the [Wiki](https://github.com/janeczku/calibre-web/wiki) For further information, How To's and FAQ please check the [Wiki](https://github.com/janeczku/calibre-web/wiki)
......
...@@ -990,10 +990,13 @@ def _config_string(to_save, x): ...@@ -990,10 +990,13 @@ def _config_string(to_save, x):
def _configuration_gdrive_helper(to_save): def _configuration_gdrive_helper(to_save):
gdrive_error = None
gdrive_secrets = {}
if not os.path.isfile(gdriveutils.SETTINGS_YAML): if not os.path.isfile(gdriveutils.SETTINGS_YAML):
config.config_use_google_drive = False config.config_use_google_drive = False
gdrive_secrets = {} if gdrive_support:
gdrive_error = gdriveutils.get_error_text(gdrive_secrets) 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: 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: with open(gdriveutils.CLIENT_SECRETS, 'r') as settings:
...@@ -1259,7 +1262,7 @@ def _configuration_result(error_flash=None, gdrive_error=None, configured=True): ...@@ -1259,7 +1262,7 @@ def _configuration_result(error_flash=None, gdrive_error=None, configured=True):
gdrivefolders = [] gdrivefolders = []
if gdrive_error is None: if gdrive_error is None:
gdrive_error = gdriveutils.get_error_text() gdrive_error = gdriveutils.get_error_text()
if gdrive_error: if gdrive_error and gdrive_support:
log.error(gdrive_error) log.error(gdrive_error)
gdrive_error = _(gdrive_error) gdrive_error = _(gdrive_error)
else: else:
......
...@@ -448,6 +448,9 @@ def edit_book_series_index(series_index, book): ...@@ -448,6 +448,9 @@ def edit_book_series_index(series_index, book):
# Add default series_index to book # Add default series_index to book
modif_date = False modif_date = False
series_index = series_index or '1' 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: if book.series_index != series_index:
book.series_index = series_index book.series_index = series_index
modif_date = True modif_date = True
......
...@@ -29,7 +29,7 @@ def get_fb2_info(tmp_file_path, original_file_extension): ...@@ -29,7 +29,7 @@ def get_fb2_info(tmp_file_path, original_file_extension):
'l': 'http://www.w3.org/1999/xlink', '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()) tree = etree.fromstring(fb2_file.read().encode())
authors = tree.xpath('/fb:FictionBook/fb:description/fb:title-info/fb:author', namespaces=ns) authors = tree.xpath('/fb:FictionBook/fb:description/fb:title-info/fb:author', namespaces=ns)
......
...@@ -122,10 +122,13 @@ def formatfloat(value, decimals=1): ...@@ -122,10 +122,13 @@ def formatfloat(value, decimals=1):
@jinjia.app_template_filter('formatseriesindex') @jinjia.app_template_filter('formatseriesindex')
def formatseriesindex_filter(series_index): def formatseriesindex_filter(series_index):
if series_index: if series_index:
try:
if int(series_index) - series_index == 0: if int(series_index) - series_index == 0:
return int(series_index) return int(series_index)
else: else:
return series_index return series_index
except ValueError:
return series_index
return 0 return 0
@jinjia.app_template_filter('uuidfilter') @jinjia.app_template_filter('uuidfilter')
......
...@@ -3,7 +3,7 @@ Flask-Babel>=0.11.1,<2.1.0 ...@@ -3,7 +3,7 @@ Flask-Babel>=0.11.1,<2.1.0
Flask-Login>=0.3.2,<0.5.1 Flask-Login>=0.3.2,<0.5.1
Flask-Principal>=0.3.2,<0.5.1 Flask-Principal>=0.3.2,<0.5.1
backports_abc>=0.4 backports_abc>=0.4
Flask>=1.0.2,<2.1.0 Flask>=1.0.2,<2.0.0
iso-639>=0.4.5,<0.5.0 iso-639>=0.4.5,<0.5.0
PyPDF3>=1.0.0,<1.0.4 PyPDF3>=1.0.0,<1.0.4
pytz>=2016.10 pytz>=2016.10
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment