From eb02c9e5d480a8f0fc20a3a801906af12bffdf8d Mon Sep 17 00:00:00 2001 From: Louis Date: Tue, 25 Feb 2025 12:49:31 +0100 Subject: [PATCH 1/8] Fix to use common djvu mimetype --- cps/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cps/__init__.py b/cps/__init__.py index 526d431f8..96a17b734 100644 --- a/cps/__init__.py +++ b/cps/__init__.py @@ -64,8 +64,8 @@ mimetypes.add_type('application/x-cbr', '.cbr') mimetypes.add_type('application/x-cbz', '.cbz') mimetypes.add_type('application/x-tar', '.cbt') mimetypes.add_type('application/x-7z-compressed', '.cb7') -mimetypes.add_type('image/vnd.djv', '.djv') -mimetypes.add_type('image/vnd.djv', '.djvu') +mimetypes.add_type('image/vnd.djvu', '.djv') +mimetypes.add_type('image/vnd.djvu', '.djvu') mimetypes.add_type('application/mpeg', '.mpeg') mimetypes.add_type('audio/mpeg', '.mp3') mimetypes.add_type('audio/x-m4a', '.m4a') From f9267ba391f151ad7d41047691f81df5503a0c49 Mon Sep 17 00:00:00 2001 From: Theo Psallidas Date: Mon, 17 Mar 2025 19:13:25 +0200 Subject: [PATCH 2/8] Fix modal for smaller devices [smartphone] --- cps/static/css/main.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cps/static/css/main.css b/cps/static/css/main.css index 3afaf7a5d..571f546c9 100644 --- a/cps/static/css/main.css +++ b/cps/static/css/main.css @@ -511,12 +511,12 @@ input:-moz-placeholder { color: #454545; } position: fixed; top: 50%; left: 50%; - width: 630px; + transform: translate(-50%, -50%); + width: 100vw; height: auto; + max-width: 630px; z-index: 2000; visibility: hidden; - margin-left: -320px; - margin-top: -160px; } .overlay { From bc0e218e73c8aee31bd9c7c2f5bc9165fcd82958 Mon Sep 17 00:00:00 2001 From: Jayson Rhynas Date: Tue, 18 Mar 2025 11:51:43 -0400 Subject: [PATCH 3/8] Added support for `storgraph:` identifiers --- cps/db.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cps/db.py b/cps/db.py index 38b3f07fd..a25261222 100644 --- a/cps/db.py +++ b/cps/db.py @@ -151,6 +151,8 @@ class Identifiers(Base): return "ISSN" elif format_type == "isfdb": return "ISFDB" + elif format_type == "storygraph": + return "StoryGraph" if format_type == "lubimyczytac": return "Lubimyczytac" if format_type == "databazeknih": @@ -194,6 +196,8 @@ class Identifiers(Base): return "http://www.isfdb.org/cgi-bin/pl.cgi?{0}".format(self.val) elif format_type == "databazeknih": return "https://www.databazeknih.cz/knihy/{0}".format(self.val) + elif format_type == "storygraph": + return "https://app.thestorygraph.com/books/{0}".format(self.val) elif self.val.lower().startswith("javascript:"): return quote(self.val) elif self.val.lower().startswith("data:"): From c6cde961b6c758e76e2d0d06a59e3701f5a0ce0e Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Tue, 25 Mar 2025 06:08:08 +0100 Subject: [PATCH 4/8] Revert Change to reenable change database function --- cps/templates/config_db.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/templates/config_db.html b/cps/templates/config_db.html index d1602cf85..6a0efc5d4 100644 --- a/cps/templates/config_db.html +++ b/cps/templates/config_db.html @@ -62,7 +62,7 @@ {% endif %} {% endif %}
- +
{{_('Save')}}
{{_('Cancel')}}
From 6bfe022de0eb0623d1abcd2f38480dacc9553445 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Tue, 25 Mar 2025 19:35:03 +0100 Subject: [PATCH 5/8] Update Teststatus --- cps/templates/config_db.html | 2 +- pyproject.toml | 36 ++++---- test/Calibre-Web TestSummary_Linux.html | 114 ++++++++---------------- 3 files changed, 56 insertions(+), 96 deletions(-) diff --git a/cps/templates/config_db.html b/cps/templates/config_db.html index 6a0efc5d4..c74bfee13 100644 --- a/cps/templates/config_db.html +++ b/cps/templates/config_db.html @@ -62,7 +62,7 @@ {% endif %} {% endif %}
-
{{_('Save')}}
+ {{_('Cancel')}}
diff --git a/pyproject.toml b/pyproject.toml index 4b86b0fa6..3c3bffbf6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,32 +26,32 @@ keywords = [ ] requires-python = ">=3.6" dependencies = [ - "APScheduler>=3.6.3,<3.11.0", + "APScheduler>=3.6.3,<3.12.0", "Babel>=1.3,<3.0", - "Flask-Babel>=0.11.1,<4.1.0", + "Flask-Babel>=3.0.0,<4.1.0", "Flask-Principal>=0.3.2,<0.5.1", - "Flask>=1.0.2,<3.1.0", + "Flask>=1.0.2,<3.2.0", "iso-639>=0.4.5,<0.5.0;python_version<'3.12'", "pycountry>=20.0.0,<25.0.0;python_version>='3.12'", - "PyPDF>=3.15.6,<5.1.0", + "PyPDF>=3.15.6,<5.5.0", "pytz>=2016.10", "requests>=2.32.0,<2.33.0", "SQLAlchemy>=1.3.0,<2.1.0", - "tornado>=6.3,<6.5", + "tornado>=6.4.2,<6.6", "Wand>=0.4.4,<0.7.0", "unidecode>=0.04.19,<1.4.0", - "lxml>=4.9.1,<5.3.0", + "lxml>=4.9.1,<5.4.0", "flask-wtf>=0.14.2,<1.3.0", "chardet>=3.0.0,<5.3.0", "netifaces-plus>=0.12.0,<0.13.0", "urllib3>=1.22,<3.0", - "Flask-Limiter>=2.3.0,<3.9.0", - "regex>=2022.3.2,<2024.6.25", + "Flask-Limiter>=2.3.0,<3.13.0", + "regex>=2022.3.2,<2025.3.20", "bleach>=6.0.0,<6.2.0", "python-magic>=0.4.27,<0.5.0", "python-magic-bin>=0.4.0,<0.5.0;sys_platform=='win32'", "flask-httpAuth>=4.4.0,<5.0.0", - "cryptography>=30.0.0,<44.0.0", + "cryptography>=43.0.4,<45.0.0", ] dynamic = ["version"] @@ -69,14 +69,14 @@ content-type = "text/markdown" [project.optional-dependencies] gdrive = [ "google-api-python-client>=1.7.11,<2.200.0", - "gevent>20.6.0,<24.3.0", - "greenlet>=0.4.17,<3.1.0", + "gevent>20.6.0,<24.12.0", + "greenlet>=0.4.17,<3.2.0", "httplib2>=0.9.2,<0.23.0", "oauth2client>=4.0.0,<4.1.4", "uritemplate>=3.0.0,<4.2.0", - "pyasn1-modules>=0.0.8,<0.5.0", + "pyasn1-modules>=0.0.8,<0.7.0", "pyasn1>=0.1.9,<0.7.0", - "PyDrive2>=1.3.1,<1.20.0", + "PyDrive2>=1.3.1,<1.22.0", "PyYAML>=3.12,<6.1", "rsa>=3.4.2,<4.10.0", ] @@ -86,23 +86,23 @@ gmail = [ ] goodreads = [ "goodreads>=0.3.2,<0.4.0", - "python-Levenshtein>=0.12.0,<0.27.0", + "python-Levenshtein>=0.12.0,<0.28.0", ] ldap = [ "python-ldap>=3.0.0,<3.5.0", "Flask-SimpleLDAP>=1.4.0,<2.1.0", ] oauth = [ - "Flask-Dance>=2.0.0,<7.1.0", + "Flask-Dance>=2.0.0,<7.2.0", "SQLAlchemy-Utils>=0.33.5,<0.42.0", ] metadata = [ "rarfile>=3.2,<5.0", "scholarly>=1.2.0,<1.8", - "markdown2>=2.0.0,<2.5.0", - "html2text>=2020.1.16,<2024.2.26", + "markdown2>=2.0.0,<2.6.0", + "html2text>=2020.1.16,<2025.2.26", "python-dateutil>=2.1,<2.10.0", - "beautifulsoup4>=4.0.1,<4.13.0", + "beautifulsoup4>=4.0.1,<4.14.0", "faust-cchardet>=2.1.18,<2.1.20", "py7zr>=0.15.0,<0.21.0", "mutagen>=1.40.0,<1.50.0", diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index fc3b5acdc..b6085c788 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2024-12-06 17:23:58

+

Start Time: 2025-03-25 20:17:40

-

Stop Time: 2024-12-07 00:45:19

+

Stop Time: 2025-03-26 03:29:00

-

Duration: 6h 11 min

+

Duration: 6h 7 min

@@ -2074,11 +2074,11 @@ IndexError: list index out of range - + TestEditBooksOnGdrive 18 - 16 - 2 + 18 + 0 0 0 @@ -2205,31 +2205,11 @@ IndexError: list index out of range - +
TestEditBooksOnGdrive - test_edit_rating
- -
- FAIL -
- - - - + PASS @@ -2261,31 +2241,11 @@ AssertionError: 4 != 0 - +
TestEditBooksOnGdrive - test_watch_metadata
- -
- FAIL -
- - - - + PASS @@ -5841,8 +5801,8 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're Total 523 - 513 - 2 + 515 + 0 1 7   @@ -5872,7 +5832,7 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're Platform - Linux 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64 x86_64 + Linux 6.8.0-52-generic #53~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 15 19:18:46 UTC 2 x86_64 x86_64 Basic @@ -5884,13 +5844,13 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're APScheduler - 3.10.4 + 3.11.0 Basic babel - 2.16.0 + 2.17.0 Basic @@ -5908,13 +5868,13 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're cryptography - 43.0.3 + 44.0.2 Basic Flask - 3.0.3 + 3.1.0 Basic @@ -5932,7 +5892,7 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're Flask-Limiter - 3.8.0 + 3.12 Basic @@ -5962,13 +5922,13 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're Jinja2 - 3.1.4 + 3.1.6 Basic lxml - 5.2.2 + 5.3.1 Basic @@ -5980,7 +5940,7 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're pypdf - 5.0.1 + 5.4.0 Basic @@ -5992,13 +5952,13 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're pytz - 2024.2 + 2025.2 Basic regex - 2024.5.15 + 2024.11.6 Basic @@ -6010,7 +5970,7 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're SQLAlchemy - 2.0.36 + 2.0.39 Basic @@ -6028,7 +5988,7 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're urllib3 - 2.2.3 + 2.3.0 Basic @@ -6046,7 +6006,7 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're google-api-python-client - 2.154.0 + 2.165.0 TestBackupMetadataGdrive @@ -6076,7 +6036,7 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're google-api-python-client - 2.154.0 + 2.165.0 TestCliGdrivedb @@ -6106,7 +6066,7 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're google-api-python-client - 2.154.0 + 2.165.0 TestEbookConvertCalibreGDrive @@ -6136,7 +6096,7 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're google-api-python-client - 2.154.0 + 2.165.0 TestEbookConvertGDriveKepubify @@ -6184,7 +6144,7 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're google-api-python-client - 2.154.0 + 2.165.0 TestEditAuthorsGdrive @@ -6214,13 +6174,13 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're beautifulsoup4 - 4.12.3 + 4.13.3 TestLoadMetadata google-api-python-client - 2.154.0 + 2.165.0 TestEditBooksOnGdrive @@ -6250,7 +6210,7 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're beautifulsoup4 - 4.12.3 + 4.13.3 TestLoadMetadataScholar @@ -6262,7 +6222,7 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're google-api-python-client - 2.154.0 + 2.165.0 TestEmbedMetadataGdrive @@ -6292,7 +6252,7 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're google-api-python-client - 2.154.0 + 2.165.0 TestSetupGdrive @@ -6328,7 +6288,7 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're python-Levenshtein - 0.26.1 + 0.27.1 TestGoodreads @@ -6388,7 +6348,7 @@ AssertionError: 'series' unexpectedly found in {'id': 5, 're From a215b73e39e0f1b102ca9137200d410afb4f74c2 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Fri, 28 Mar 2025 16:52:10 +0100 Subject: [PATCH 6/8] Lower requirement of cryptography --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ad47f3635..15d6ff2e3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,4 +23,4 @@ bleach>=6.0.0,<6.2.0 python-magic>=0.4.27,<0.5.0 python-magic-bin>=0.4.0,<0.5.0;sys_platform=='win32' flask-httpAuth>=4.4.0,<5.0.0 -cryptography>=43.0.4,<45.0.0 +cryptography>=39.0.0,<45.0.0 From 854a7d020dfe5713b8a48356ba53a58600af3296 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Fri, 28 Mar 2025 17:23:45 +0100 Subject: [PATCH 7/8] Better error output for "empty" Author sort not working Update bleach requirement --- cps/db.py | 3 ++- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cps/db.py b/cps/db.py index 38b3f07fd..9840643ce 100644 --- a/cps/db.py +++ b/cps/db.py @@ -901,7 +901,8 @@ class CalibreDB: results = self.session.query(Authors).filter(Authors.sort == auth).all() # ToDo: How to handle not found author name if not len(results): - log.error("Author {} not found to display name in right order".format(auth)) + book_id = entry.id if isinstance(entry, Books) else entry[0].id + log.error("Author '{}' of book {} not found to display name in right order".format(auth, book_id)) # error = True break for r in results: diff --git a/requirements.txt b/requirements.txt index 15d6ff2e3..e6ee645a8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,7 +19,7 @@ netifaces-plus>=0.12.0,<0.13.0 urllib3>=1.22,<3.0 Flask-Limiter>=2.3.0,<3.13.0 regex>=2022.3.2,<2025.3.20 -bleach>=6.0.0,<6.2.0 +bleach>=6.0.0,<6.3.0 python-magic>=0.4.27,<0.5.0 python-magic-bin>=0.4.0,<0.5.0;sys_platform=='win32' flask-httpAuth>=4.4.0,<5.0.0 From 65a29ed4c97a0250135ab12d2825c260806f617c Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 30 Mar 2025 08:58:56 +0200 Subject: [PATCH 8/8] Log exception for unhandled errors in background tasks --- cps/services/worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/services/worker.py b/cps/services/worker.py index dce3da797..2a0809cab 100644 --- a/cps/services/worker.py +++ b/cps/services/worker.py @@ -199,7 +199,7 @@ class CalibreTask: self.run(*args) except Exception as ex: self._handleError(str(ex)) - log.error_or_exception(ex) + log.exception(ex) self.end_time = datetime.now()