From cb7356a04df08ad65fea9d15e5eeef3f20f0f195 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Thu, 4 May 2023 20:23:02 +0300 Subject: [PATCH 1/4] Fixes to word with new version of comicapi --- cps/comic.py | 21 ++++++++++++++------- requirements.txt | 3 +-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/cps/comic.py b/cps/comic.py index 766b4584..907614c9 100644 --- a/cps/comic.py +++ b/cps/comic.py @@ -89,12 +89,14 @@ def _extract_cover(tmp_file_name, original_file_extension, rar_executable): cover_data = extension = None if use_comic_meta: archive = ComicArchive(tmp_file_name, rar_exe_path=rar_executable) - for index, name in enumerate(archive.getPageNameList()): + name_list = archive.getPageNameList if hasattr(archive, "getPageNameList") else archive.get_page_name_list + for index, name in enumerate(name_list()): ext = os.path.splitext(name) if len(ext) > 1: extension = ext[1].lower() if extension in cover.COVER_EXTENSIONS: - cover_data = archive.getPage(index) + get_page = archive.getPage if hasattr(archive, "getPageNameList") else archive.get_page + cover_data = get_page(index) break else: cover_data, extension = _extract_cover_from_archive(original_file_extension, tmp_file_name, rar_executable) @@ -104,16 +106,21 @@ def _extract_cover(tmp_file_name, original_file_extension, rar_executable): def get_comic_info(tmp_file_path, original_file_name, original_file_extension, rar_executable): if use_comic_meta: archive = ComicArchive(tmp_file_path, rar_exe_path=rar_executable) - if archive.seemsToBeAComicArchive(): - if archive.hasMetadata(MetaDataStyle.CIX): + if hasattr(archive, "seemsToBeAComicArchive"): + seems_archive = archive.seemsToBeAComicArchive + else: + seems_archive = archive.seems_to_be_a_comic_archive + if seems_archive(): + has_metadata = archive.hasMetadata if hasattr(archive, "hasMetadata") else archive.has_metadata + if has_metadata(MetaDataStyle.CIX): style = MetaDataStyle.CIX - elif archive.hasMetadata(MetaDataStyle.CBI): + elif has_metadata(MetaDataStyle.CBI): style = MetaDataStyle.CBI else: style = None - # if style is not None: - loaded_metadata = archive.readMetadata(style) + read_metadata = archive.readMetadata if hasattr(archive, "readMetadata") else archive.read_metadata + loaded_metadata = read_metadata(style) lang = loaded_metadata.language or "" loaded_metadata.language = isoLanguages.get_lang3(lang) diff --git a/requirements.txt b/requirements.txt index f0cd81c0..fef4bbf2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,9 @@ APScheduler>=3.6.3,<3.11.0 -werkzeug<2.1.0 Babel>=1.3,<3.0 Flask-Babel>=0.11.1,<3.1.0 Flask-Login>=0.3.2,<0.6.3 Flask-Principal>=0.3.2,<0.5.1 -Flask>=1.0.2,<2.3.0 +Flask>=1.0.2,<2.4.0 iso-639>=0.4.5,<0.5.0 PyPDF>=3.0.0,<3.8.0 pytz>=2016.10 From 16baa306c544ba8d3595ceab2e226df65b43ab42 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 27 May 2023 15:32:48 +0200 Subject: [PATCH 2/4] Update test results --- setup.cfg | 7 +- test/Calibre-Web TestSummary_Linux.html | 680 +++++++++++------------- 2 files changed, 300 insertions(+), 387 deletions(-) diff --git a/setup.cfg b/setup.cfg index 67d09ae8..5bf940bd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -39,15 +39,13 @@ console_scripts = include_package_data = True install_requires = APScheduler>=3.6.3,<3.11.0 - werkzeug<2.1.0 Babel>=1.3,<3.0 Flask-Babel>=0.11.1,<3.1.0 Flask-Login>=0.3.2,<0.6.3 Flask-Principal>=0.3.2,<0.5.1 - backports_abc>=0.4 - Flask>=1.0.2,<2.3.0 + Flask>=1.0.2,<2.4.0 iso-639>=0.4.5,<0.5.0 - PyPDF>=3.0.0,<3.6.0 + PyPDF>=3.0.0,<3.8.0 pytz>=2016.10 requests>=2.11.1,<2.29.0 SQLAlchemy>=1.3.0,<2.0.0 @@ -93,6 +91,7 @@ metadata = html2text>=2020.1.16,<2022.1.1 python-dateutil>=2.1,<2.9.0 beautifulsoup4>=4.0.1,<4.12.0 + faust-cchardet>=2.1.18 comics = natsort>=2.2.0,<8.4.0 comicapi>=2.2.0,<2.3.0 diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index 0fe291df..43d0443a 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2023-04-13 19:29:13

+

Start Time: 2023-05-21 19:43:08

-

Stop Time: 2023-04-14 09:30:28

+

Stop Time: 2023-05-22 02:38:06

-

Duration: 13h 2 min

+

Duration: 5h 50 min

@@ -852,89 +852,70 @@ - - _ErrorHolder - 1 + + TestEbookConvertCalibreGDrive + 6 + 6 0 0 - 1 0 - Detail + Detail - + -
setUpClass (test_ebook_convert_gdrive)
+
TestEbookConvertCalibreGDrive - test_convert_email
- -
- ERROR -
- - - + PASS + + + + + + +
TestEbookConvertCalibreGDrive - test_convert_failed_and_email
+ + PASS + + + + + + +
TestEbookConvertCalibreGDrive - test_convert_only
+ + PASS + + + + + + +
TestEbookConvertCalibreGDrive - test_convert_parameter
+ + PASS + + + + + + +
TestEbookConvertCalibreGDrive - test_email_failed
+ + PASS + + + + + + +
TestEbookConvertCalibreGDrive - test_email_only
+ PASS @@ -1617,11 +1598,11 @@ TimeoutError: The read operation timed out - + TestEditAuthorsGdrive 6 - 3 - 3 + 6 + 0 0 0 @@ -1640,60 +1621,20 @@ TimeoutError: The read operation timed out - +
TestEditAuthorsGdrive - test_change_capital_one_author_one_book
- -
- FAIL -
- - - - + PASS - +
TestEditAuthorsGdrive - test_change_capital_one_author_two_books
- -
- FAIL -
- - - - + PASS @@ -1716,31 +1657,11 @@ AssertionError: 200 != 404 - +
TestEditAuthorsGdrive - test_rename_capital_on_upload
- -
- FAIL -
- - - - + PASS @@ -1923,11 +1844,11 @@ AssertionError: 200 != 404 - + TestLoadMetadata 1 - 1 0 + 1 0 0 @@ -1937,11 +1858,31 @@ AssertionError: 200 != 404 - +
TestLoadMetadata - test_load_metadata
- PASS + +
+ FAIL +
+ + + + @@ -2124,13 +2065,13 @@ AssertionError: 200 != 404 - + TestLoadMetadataScholar 1 - 0 1 0 0 + 0 Detail @@ -2138,31 +2079,11 @@ AssertionError: 200 != 404 - +
TestLoadMetadataScholar - test_load_metadata
- -
- FAIL -
- - - - + PASS @@ -2470,11 +2391,11 @@ AssertionError: 30 != 0 - + TestKoboSync 12 - 12 - 0 + 7 + 5 0 0 @@ -2529,11 +2450,31 @@ AssertionError: 30 != 0 - +
TestKoboSync - test_shelves_add_remove_books
- PASS + +
+ FAIL +
+ + + + @@ -2556,38 +2497,133 @@ AssertionError: 30 != 0 - +
TestKoboSync - test_sync_reading_state
- PASS + +
+ FAIL +
+ + + + - +
TestKoboSync - test_sync_shelf
- PASS + +
+ FAIL +
+ + + + - +
TestKoboSync - test_sync_unchanged
- PASS + +
+ FAIL +
+ + + + - +
TestKoboSync - test_sync_upload
- PASS + +
+ FAIL +
+ + + + @@ -3063,11 +3099,11 @@ AssertionError: 30 != 0 - + TestLogin 17 - 16 - 1 + 17 + 0 0 0 @@ -3131,31 +3167,11 @@ AssertionError: 30 != 0 - +
TestLogin - test_login_protected
- -
- FAIL -
- - - - + PASS @@ -3317,11 +3333,11 @@ AssertionError: 1 != 2 - + TestOPDSFeed 23 - 23 - 0 + 22 + 1 0 0 @@ -3475,11 +3491,31 @@ AssertionError: 1 != 2 - +
TestOPDSFeed - test_opds_search
- PASS + +
+ FAIL +
+ + + + @@ -4027,12 +4063,12 @@ AssertionError: 1 != 2 - + TestThumbnails 8 - 2 - 4 - 1 + 7 + 0 + 0 1 Detail @@ -4050,89 +4086,29 @@ AssertionError: 1 != 2 - +
TestThumbnails - test_cache_of_deleted_book
- -
- FAIL -
- - - - + PASS - +
TestThumbnails - test_cover_cache_on_database_change
- -
- FAIL -
- - - - + PASS - +
TestThumbnails - test_cover_change_on_upload_new_cover
- -
- FAIL -
- - - - + PASS @@ -4155,60 +4131,20 @@ AssertionError: False is not true - +
TestThumbnails - test_remove_cover_from_cache
- -
- ERROR -
- - - - + PASS - +
TestThumbnails - test_sideloaded_book
- -
- FAIL -
- - - - + PASS @@ -4792,11 +4728,11 @@ AssertionError: 2 != 0 - + TestCalibreWebVisibilitys 35 - 34 - 1 + 35 + 0 0 0 @@ -5085,33 +5021,11 @@ AssertionError: 2 != 0 - +
TestCalibreWebVisibilitys - test_search_order
- -
- FAIL -
- - - - + PASS @@ -5304,10 +5218,10 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new Total - 450 - 431 - 10 - 2 + 455 + 441 + 7 + 0 7   @@ -5336,7 +5250,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new Platform - Linux 5.19.0-38-generic #39~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 17 21:16:15 UTC 2 x86_64 x86_64 + Linux 5.19.0-41-generic #42~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 18 17:40:00 UTC 2 x86_64 x86_64 Basic @@ -5372,7 +5286,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new Flask - 2.1.3 + 2.3.2 Basic @@ -5384,7 +5298,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new Flask-Limiter - 3.3.0 + 3.3.1 Basic @@ -5432,7 +5346,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new pyasn1 - 0.4.8 + 0.5.0 Basic @@ -5456,7 +5370,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new SQLAlchemy - 2.0.9 + 1.4.48 Basic @@ -5480,13 +5394,13 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new Werkzeug - 2.0.3 + 2.3.4 Basic google-api-python-client - 2.85.0 + 2.86.0 TestBackupMetadataGdrive @@ -5504,7 +5418,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new PyDrive2 - 1.15.3 + 1.15.4 TestBackupMetadataGdrive @@ -5516,7 +5430,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new google-api-python-client - 2.85.0 + 2.86.0 TestCliGdrivedb @@ -5534,7 +5448,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new PyDrive2 - 1.15.3 + 1.15.4 TestCliGdrivedb @@ -5546,7 +5460,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new google-api-python-client - 2.85.0 + 2.86.0 TestEbookConvertCalibreGDrive @@ -5564,7 +5478,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new PyDrive2 - 1.15.3 + 1.15.4 TestEbookConvertCalibreGDrive @@ -5576,7 +5490,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new google-api-python-client - 2.85.0 + 2.86.0 TestEbookConvertGDriveKepubify @@ -5594,7 +5508,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new PyDrive2 - 1.15.3 + 1.15.4 TestEbookConvertGDriveKepubify @@ -5618,7 +5532,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new google-api-python-client - 2.85.0 + 2.86.0 TestEditAuthorsGdrive @@ -5636,7 +5550,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new PyDrive2 - 1.15.3 + 1.15.4 TestEditAuthorsGdrive @@ -5654,7 +5568,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new google-api-python-client - 2.85.0 + 2.86.0 TestEditBooksOnGdrive @@ -5672,7 +5586,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new PyDrive2 - 1.15.3 + 1.15.4 TestEditBooksOnGdrive @@ -5696,7 +5610,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new google-api-python-client - 2.85.0 + 2.86.0 TestSetupGdrive @@ -5714,7 +5628,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new PyDrive2 - 1.15.3 + 1.15.4 TestSetupGdrive @@ -5732,7 +5646,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new python-Levenshtein - 0.20.9 + 0.21.0 TestGoodreads @@ -5768,13 +5682,13 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new Flask-Dance - 6.2.0 + 7.0.0 TestOAuthLogin SQLAlchemy-Utils - 0.41.0 + 0.41.1 TestOAuthLogin @@ -5786,7 +5700,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new From 8a87c152b4b5ce7c4dc162f5fc2e2e3ba1899031 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 27 May 2023 16:25:06 +0200 Subject: [PATCH 3/4] Bugfix opds search --- cps/opds.py | 2 +- cps/templates/feed.xml | 2 +- cps/templates/index.xml | 2 +- cps/templates/osd.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cps/opds.py b/cps/opds.py index 6b09a84d..074a9b73 100644 --- a/cps/opds.py +++ b/cps/opds.py @@ -55,7 +55,7 @@ def feed_osd(): return render_xml_template('osd.xml', lang='en-EN') -@opds.route("/opds/search", defaults={'query': ""}) +# @opds.route("/opds/search", defaults={'query': ""}) @opds.route("/opds/search/") @requires_basic_auth_if_no_ano def feed_cc_search(query): diff --git a/cps/templates/feed.xml b/cps/templates/feed.xml index d2114157..a483a57f 100644 --- a/cps/templates/feed.xml +++ b/cps/templates/feed.xml @@ -30,7 +30,7 @@ - + {{instance}} {{instance}} diff --git a/cps/templates/index.xml b/cps/templates/index.xml index 4ffd4290..bee40d66 100644 --- a/cps/templates/index.xml +++ b/cps/templates/index.xml @@ -8,7 +8,7 @@ - + {{instance}} {{instance}} diff --git a/cps/templates/osd.xml b/cps/templates/osd.xml index 674303c2..27adb26e 100644 --- a/cps/templates/osd.xml +++ b/cps/templates/osd.xml @@ -6,7 +6,7 @@ Janeczku https://github.com/janeczku/calibre-web + template="{{url_for('opds.feed_normal_search')}}/{searchTerms}"/> open From dad0fd5a1c9222c6ce55a51311d7590b6f1a91f6 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 28 May 2023 10:24:40 +0200 Subject: [PATCH 4/4] Update test results --- test/Calibre-Web TestSummary_Linux.html | 257 ++++++------------------ 1 file changed, 62 insertions(+), 195 deletions(-) diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index 43d0443a..a67aac78 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2023-05-21 19:43:08

+

Start Time: 2023-05-27 20:05:01

-

Stop Time: 2023-05-22 02:38:06

+

Stop Time: 2023-05-28 03:05:40

-

Duration: 5h 50 min

+

Duration: 5h 54 min

@@ -471,11 +471,11 @@ - + TestCli 12 - 12 - 0 + 11 + 1 0 0 @@ -503,11 +503,33 @@ - +
TestCli - test_change_password
- PASS + +
+ FAIL +
+ + + + @@ -1844,13 +1866,13 @@ - + TestLoadMetadata 1 - 0 1 0 0 + 0 Detail @@ -1858,31 +1880,11 @@ - +
TestLoadMetadata - test_load_metadata
- -
- FAIL -
- - - - + PASS @@ -2391,11 +2393,11 @@ AssertionError: 20 != 10 - + TestKoboSync 12 - 7 - 5 + 12 + 0 0 0 @@ -2450,31 +2452,11 @@ AssertionError: 20 != 10 - +
TestKoboSync - test_shelves_add_remove_books
- -
- FAIL -
- - - - + PASS @@ -2497,133 +2479,38 @@ AssertionError: 400 != 415 - +
TestKoboSync - test_sync_reading_state
- -
- FAIL -
- - - - + PASS - +
TestKoboSync - test_sync_shelf
- -
- FAIL -
- - - - + PASS - +
TestKoboSync - test_sync_unchanged
- -
- FAIL -
- - - - + PASS - +
TestKoboSync - test_sync_upload
- -
- FAIL -
- - - - + PASS @@ -3333,11 +3220,11 @@ AssertionError: 1 != 2 - + TestOPDSFeed 23 - 22 - 1 + 23 + 0 0 0 @@ -3491,31 +3378,11 @@ AssertionError: 1 != 2 - +
TestOPDSFeed - test_opds_search
- -
- FAIL -
- - - - + PASS @@ -5219,8 +5086,8 @@ AssertionError: 200 != 500 Total 455 - 441 - 7 + 447 + 1 0 7   @@ -5400,7 +5267,7 @@ AssertionError: 200 != 500 google-api-python-client - 2.86.0 + 2.87.0 TestBackupMetadataGdrive @@ -5430,7 +5297,7 @@ AssertionError: 200 != 500 google-api-python-client - 2.86.0 + 2.87.0 TestCliGdrivedb @@ -5460,7 +5327,7 @@ AssertionError: 200 != 500 google-api-python-client - 2.86.0 + 2.87.0 TestEbookConvertCalibreGDrive @@ -5490,7 +5357,7 @@ AssertionError: 200 != 500 google-api-python-client - 2.86.0 + 2.87.0 TestEbookConvertGDriveKepubify @@ -5532,7 +5399,7 @@ AssertionError: 200 != 500 google-api-python-client - 2.86.0 + 2.87.0 TestEditAuthorsGdrive @@ -5568,7 +5435,7 @@ AssertionError: 200 != 500 google-api-python-client - 2.86.0 + 2.87.0 TestEditBooksOnGdrive @@ -5610,7 +5477,7 @@ AssertionError: 200 != 500 google-api-python-client - 2.86.0 + 2.87.0 TestSetupGdrive @@ -5700,7 +5567,7 @@ AssertionError: 200 != 500