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/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 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 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..a67aac78 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-27 20:05:01

-

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

+

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

-

Duration: 13h 2 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 +
+ + + + @@ -852,89 +874,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 +1620,11 @@ TimeoutError: The read operation timed out - + TestEditAuthorsGdrive 6 - 3 - 3 + 6 + 0 0 0 @@ -1640,60 +1643,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 +1679,11 @@ AssertionError: 200 != 404 - +
TestEditAuthorsGdrive - test_rename_capital_on_upload
- -
- FAIL -
- - - - + PASS @@ -2124,13 +2067,13 @@ AssertionError: 200 != 404 - + TestLoadMetadataScholar 1 - 0 1 0 0 + 0 Detail @@ -2138,31 +2081,11 @@ AssertionError: 200 != 404 - +
TestLoadMetadataScholar - test_load_metadata
- -
- FAIL -
- - - - + PASS @@ -3063,11 +2986,11 @@ AssertionError: 30 != 0 - + TestLogin 17 - 16 - 1 + 17 + 0 0 0 @@ -3131,31 +3054,11 @@ AssertionError: 30 != 0 - +
TestLogin - test_login_protected
- -
- FAIL -
- - - - + PASS @@ -4027,12 +3930,12 @@ AssertionError: 1 != 2 - + TestThumbnails 8 - 2 - 4 - 1 + 7 + 0 + 0 1 Detail @@ -4050,89 +3953,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 +3998,20 @@ AssertionError: False is not true - +
TestThumbnails - test_remove_cover_from_cache
- -
- ERROR -
- - - - + PASS - +
TestThumbnails - test_sideloaded_book
- -
- FAIL -
- - - - + PASS @@ -4792,11 +4595,11 @@ AssertionError: 2 != 0 - + TestCalibreWebVisibilitys 35 - 34 - 1 + 35 + 0 0 0 @@ -5085,33 +4888,11 @@ AssertionError: 2 != 0 - +
TestCalibreWebVisibilitys - test_search_order
- -
- FAIL -
- - - - + PASS @@ -5304,10 +5085,10 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new Total - 450 - 431 - 10 - 2 + 455 + 447 + 1 + 0 7   @@ -5336,7 +5117,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 +5153,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new Flask - 2.1.3 + 2.3.2 Basic @@ -5384,7 +5165,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new Flask-Limiter - 3.3.0 + 3.3.1 Basic @@ -5432,7 +5213,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new pyasn1 - 0.4.8 + 0.5.0 Basic @@ -5456,7 +5237,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new SQLAlchemy - 2.0.9 + 1.4.48 Basic @@ -5480,13 +5261,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.87.0 TestBackupMetadataGdrive @@ -5504,7 +5285,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new PyDrive2 - 1.15.3 + 1.15.4 TestBackupMetadataGdrive @@ -5516,7 +5297,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new google-api-python-client - 2.85.0 + 2.87.0 TestCliGdrivedb @@ -5534,7 +5315,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new PyDrive2 - 1.15.3 + 1.15.4 TestCliGdrivedb @@ -5546,7 +5327,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new google-api-python-client - 2.85.0 + 2.87.0 TestEbookConvertCalibreGDrive @@ -5564,7 +5345,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new PyDrive2 - 1.15.3 + 1.15.4 TestEbookConvertCalibreGDrive @@ -5576,7 +5357,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new google-api-python-client - 2.85.0 + 2.87.0 TestEbookConvertGDriveKepubify @@ -5594,7 +5375,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new PyDrive2 - 1.15.3 + 1.15.4 TestEbookConvertGDriveKepubify @@ -5618,7 +5399,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new google-api-python-client - 2.85.0 + 2.87.0 TestEditAuthorsGdrive @@ -5636,7 +5417,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new PyDrive2 - 1.15.3 + 1.15.4 TestEditAuthorsGdrive @@ -5654,7 +5435,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new google-api-python-client - 2.85.0 + 2.87.0 TestEditBooksOnGdrive @@ -5672,7 +5453,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new PyDrive2 - 1.15.3 + 1.15.4 TestEditBooksOnGdrive @@ -5696,7 +5477,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new google-api-python-client - 2.85.0 + 2.87.0 TestSetupGdrive @@ -5714,7 +5495,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new PyDrive2 - 1.15.3 + 1.15.4 TestSetupGdrive @@ -5732,7 +5513,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new python-Levenshtein - 0.20.9 + 0.21.0 TestGoodreads @@ -5768,13 +5549,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 +5567,7 @@ AssertionError: 9 != 8 : Key sorting order wrong: pub_new