diff --git a/README.md b/README.md index 4a3db6311..bc9c60bd3 100644 --- a/README.md +++ b/README.md @@ -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. +![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.* ![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: + The "path to convertertool" should be set to `/usr/bin/ebook-convert` + 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) diff --git a/cps/admin.py b/cps/admin.py index 90a5feb50..cfebbcf00 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -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: diff --git a/cps/editbooks.py b/cps/editbooks.py index 83def9deb..b5791c541 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -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 diff --git a/cps/fb2.py b/cps/fb2.py index d7b03d5b3..af4a29a70 100644 --- a/cps/fb2.py +++ b/cps/fb2.py @@ -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) diff --git a/cps/jinjia.py b/cps/jinjia.py index f37dfb497..de34cc86e 100644 --- a/cps/jinjia.py +++ b/cps/jinjia.py @@ -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 diff --git a/requirements.txt b/requirements.txt index b29d3b99c..ed464d7d3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ Flask-Babel>=0.11.1,<2.1.0 Flask-Login>=0.3.2,<0.5.1 Flask-Principal>=0.3.2,<0.5.1 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 PyPDF3>=1.0.0,<1.0.4 pytz>=2016.10 diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index bb9991400..1323624e8 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2021-04-27 20:06:09

+

Start Time: 2021-05-19 20:16:09

-

Stop Time: 2021-04-27 23:04:55

+

Stop Time: 2021-05-19 23:20:56

-

Duration: 2h 24 min

+

Duration: 2h 32 min

@@ -820,13 +820,13 @@ TestEditBooks - 33 - 31 + 35 + 34 0 0 - 2 + 1 - Detail + Detail @@ -888,7 +888,7 @@ -
TestEditBooks - test_edit_custom_float
+
TestEditBooks - test_edit_custom_comment
PASS @@ -897,7 +897,7 @@ -
TestEditBooks - test_edit_custom_int
+
TestEditBooks - test_edit_custom_date
PASS @@ -906,7 +906,7 @@ -
TestEditBooks - test_edit_custom_rating
+
TestEditBooks - test_edit_custom_float
PASS @@ -915,7 +915,7 @@ -
TestEditBooks - test_edit_custom_single_select
+
TestEditBooks - test_edit_custom_int
PASS @@ -924,7 +924,7 @@ -
TestEditBooks - test_edit_custom_text
+
TestEditBooks - test_edit_custom_rating
PASS @@ -933,7 +933,7 @@ -
TestEditBooks - test_edit_language
+
TestEditBooks - test_edit_custom_single_select
PASS @@ -942,42 +942,25 @@ -
TestEditBooks - test_edit_publisher
+
TestEditBooks - test_edit_custom_text
PASS - + -
TestEditBooks - test_edit_publishing_date
- - -
- SKIP -
- - - +
TestEditBooks - test_edit_language
+ PASS -
TestEditBooks - test_edit_rating
+
TestEditBooks - test_edit_publisher
PASS @@ -986,7 +969,7 @@ -
TestEditBooks - test_edit_series
+
TestEditBooks - test_edit_publishing_date
PASS @@ -994,6 +977,24 @@ + +
TestEditBooks - test_edit_rating
+ + PASS + + + + + + +
TestEditBooks - test_edit_series
+ + PASS + + + + +
TestEditBooks - test_edit_title
@@ -1002,19 +1003,19 @@ - +
TestEditBooks - test_rename_uppercase_lowercase
- SKIP + SKIP
-