From 4523a12708107408cfe26b05df7550aea1db6cd4 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 11 Aug 2024 08:21:01 +0200 Subject: [PATCH] Fixes after testrun --- cps/debug_info.py | 3 +- cps/jinjia.py | 1 - cps/kobo.py | 8 +- setup.cfg | 3 +- test/Calibre-Web TestSummary_Linux.html | 1622 +++++++++++++++-------- 5 files changed, 1065 insertions(+), 572 deletions(-) diff --git a/cps/debug_info.py b/cps/debug_info.py index 3be60700..3907f2a7 100644 --- a/cps/debug_info.py +++ b/cps/debug_info.py @@ -74,7 +74,8 @@ def send_debug(): for fp in file_list: zf.write(fp, os.path.basename(fp)) memory_zip.seek(0) - if int(__version__.split('.')[0]) < 2: + version = importlib.metadata.version("flask") + if int(version.split('.')[0]) < 2: return send_file(memory_zip, as_attachment=True, attachment_filename="Calibre-Web-debug-pack.zip") diff --git a/cps/jinjia.py b/cps/jinjia.py index 80c2b7ea..01abf5a6 100644 --- a/cps/jinjia.py +++ b/cps/jinjia.py @@ -26,7 +26,6 @@ from markupsafe import escape import datetime import mimetypes from uuid import uuid4 -import re from flask import Blueprint, request, url_for from flask_babel import format_date diff --git a/cps/kobo.py b/cps/kobo.py index bd4deea5..03fc29c3 100644 --- a/cps/kobo.py +++ b/cps/kobo.py @@ -150,15 +150,15 @@ def HandleSyncRequest(): # if no books synced don't respect sync_token if not ub.session.query(ub.KoboSyncedBooks).filter(ub.KoboSyncedBooks.user_id == current_user.id).count(): - sync_token.books_last_modified = datetime.datetime.min - sync_token.books_last_created = datetime.datetime.min - sync_token.reading_state_last_modified = datetime.datetime.min + sync_token.books_last_modified = datetime.min + sync_token.books_last_created = datetime.min + sync_token.reading_state_last_modified = datetime.min new_books_last_modified = sync_token.books_last_modified # needed for sync selected shelfs only new_books_last_created = sync_token.books_last_created # needed to distinguish between new and changed entitlement new_reading_state_last_modified = sync_token.reading_state_last_modified - new_archived_last_modified = datetime.datetime.min + new_archived_last_modified = datetime.min sync_results = [] # We reload the book database so that the user gets a fresh view of the library diff --git a/setup.cfg b/setup.cfg index 26eef25d..2d326d62 100644 --- a/setup.cfg +++ b/setup.cfg @@ -53,7 +53,7 @@ install_requires = unidecode>=0.04.19,<1.4.0 lxml>=4.9.1,<5.3.0 flask-wtf>=0.14.2,<1.3.0 - chardet>=3.0.0,<4.1.0 + chardet>=3.0.0,<5.3.0 advocate>=1.0.0,<1.1.0 Flask-Limiter>=2.3.0,<3.9.0 regex>=2022.3.2,<2024.6.25 @@ -100,6 +100,7 @@ metadata = beautifulsoup4>=4.0.1,<4.13.0 faust-cchardet>=2.1.18,<2.1.20 py7zr>=0.15.0,<0.21.0 + mutagen>=1.40.0,<1.50.0 comics = natsort>=2.2.0,<8.5.0 comicapi>=2.2.0,<3.3.0 diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index 3bd3a93d..ccd12d1b 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2024-08-03 20:30:20

+

Start Time: 2024-08-10 21:08:57

-

Stop Time: 2024-08-04 04:01:30

+

Stop Time: 2024-08-11 04:24:46

-

Duration: 6h 17 min

+

Duration: 6h 0 min

@@ -852,11 +852,11 @@ - + TestEbookConvertCalibreGDrive 7 - 7 - 0 + 6 + 1 0 0 @@ -911,11 +911,33 @@ - +
TestEbookConvertCalibreGDrive - test_email_only
- PASS + +
+ FAIL +
+ + + + @@ -972,11 +994,11 @@ - + TestEbookConvertGDriveKepubify 3 - 2 - 1 + 3 + 0 0 0 @@ -995,33 +1017,11 @@ - +
TestEbookConvertGDriveKepubify - test_convert_only
- -
- FAIL -
- - - - + PASS @@ -1248,11 +1248,11 @@ AssertionError: 1 != 3 - + TestEditBooks 38 - 36 - 0 + 31 + 5 0 2 @@ -1334,47 +1334,154 @@ AssertionError: 1 != 3 - +
TestEditBooks - test_edit_custom_float
- PASS + +
+ FAIL +
+ + + + - +
TestEditBooks - test_edit_custom_int
- PASS + +
+ FAIL +
+ + + + - +
TestEditBooks - test_edit_custom_rating
- PASS + +
+ FAIL +
+ + + + - +
TestEditBooks - test_edit_custom_single_select
- PASS + +
+ FAIL +
+ + + + - +
TestEditBooks - test_edit_custom_text
- PASS + +
+ FAIL +
+ + + + @@ -1639,12 +1746,12 @@ AssertionError: 1 != 3 - + TestEditAuthors 9 - 5 + 9 + 0 0 - 4 0 Detail @@ -1662,118 +1769,38 @@ AssertionError: 1 != 3 - +
TestEditAuthors - test_change_capital_one_author_one_book
- -
- ERROR -
- - - - + PASS - +
TestEditAuthors - test_change_capital_one_author_two_books
- -
- ERROR -
- - - - + PASS - +
TestEditAuthors - test_change_capital_one_author_two_books_coauthor
- -
- ERROR -
- - - - + PASS - +
TestEditAuthors - test_change_capital_rename_co_author
- -
- ERROR -
- - - - + PASS @@ -2206,8 +2233,8 @@ NameError: name 'SMB_LIB' is not defined
Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/test/test_edit_books_metadata.py", line 69, in test_load_metadata
-    if 'https://comicvine.gamespot.com/' == results[10]['source']:
+  File "/home/ozzie/Development/calibre-web-test/test/test_edit_books_metadata.py", line 90, in test_load_metadata
+    elif len(results)>19 and 'https://amazon.com/' == results[20]['source']:
 IndexError: list index out of range
@@ -2219,11 +2246,11 @@ IndexError: list index out of range - + TestEditBooksOnGdrive 18 - 18 - 0 + 13 + 5 0 0 @@ -2287,47 +2314,154 @@ IndexError: list index out of range - +
TestEditBooksOnGdrive - test_edit_custom_float
- PASS + +
+ FAIL +
+ + + + - +
TestEditBooksOnGdrive - test_edit_custom_int
- PASS + +
+ FAIL +
+ + + + - +
TestEditBooksOnGdrive - test_edit_custom_rating
- PASS + +
+ FAIL +
+ + + + - +
TestEditBooksOnGdrive - test_edit_custom_single_select
- PASS + +
+ FAIL +
+ + + + - +
TestEditBooksOnGdrive - test_edit_custom_text
- PASS + +
+ FAIL +
+ + + + @@ -2396,13 +2530,13 @@ IndexError: list index out of range - + TestLoadMetadataScholar 1 - 0 1 0 0 + 0 Detail @@ -2410,41 +2544,21 @@ IndexError: list index out of range - +
TestLoadMetadataScholar - test_load_metadata
- -
- FAIL -
- - - - + PASS - + TestSTARTTLS 3 - 2 - 1 + 3 + 0 0 0 @@ -2454,33 +2568,11 @@ AssertionError: 30 != 0 - +
TestSTARTTLS - test_STARTTLS
- -
- FAIL -
- - - - + PASS @@ -2884,11 +2976,11 @@ AssertionError: 1 != 2 - + TestKoboSync 12 - 12 - 0 + 4 + 8 0 0 @@ -2898,11 +2990,35 @@ AssertionError: 1 != 2 - +
TestKoboSync - test_book_download
- PASS + +
+ FAIL +
+ + + + @@ -2934,29 +3050,101 @@ AssertionError: 1 != 2 - +
TestKoboSync - test_kobo_sync_selected_shelfs
- PASS + +
+ FAIL +
+ + + + - +
TestKoboSync - test_shelves_add_remove_books
- PASS + +
+ FAIL +
+ + + + - +
TestKoboSync - test_sync_changed_book
- PASS + +
+ FAIL +
+ + + + @@ -2970,48 +3158,144 @@ AssertionError: 1 != 2 - +
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 +
+ + + + - + TestKoboSyncBig 6 - 6 0 + 6 0 0 @@ -3021,56 +3305,188 @@ AssertionError: 1 != 2 - +
TestKoboSyncBig - test_download_cover
- PASS + +
+ FAIL +
+ + + + - +
TestKoboSyncBig - test_kobo_sync_multi_user
- PASS + +
+ FAIL +
+ + + + - +
TestKoboSyncBig - test_kobo_sync_selected_shelves
- PASS + +
+ FAIL +
+ + + + - +
TestKoboSyncBig - test_sync_changed_book
- PASS + +
+ FAIL +
+ + + + - +
TestKoboSyncBig - test_sync_reading_state
- PASS + +
+ FAIL +
+ + + + - +
TestKoboSyncBig - test_sync_shelf
- PASS + +
+ FAIL +
+ + + + @@ -3427,11 +3843,11 @@ AssertionError: 1 != 2 - + TestLogging 9 - 8 - 0 + 7 + 1 0 1 @@ -3459,11 +3875,33 @@ AssertionError: 1 != 2 - +
TestLogging - test_debuginfo_download
- PASS + +
+ FAIL +
+ + + + @@ -4882,6 +5320,55 @@ AssertionError: 1 != 2 + + _FailedTest + 1 + 0 + 0 + 1 + 0 + + Detail + + + + + + + +
_FailedTest - test_upload_audio
+ + +
+ ERROR +
+ + + + + + + + + TestUploadEPubs 6 @@ -4890,13 +5377,13 @@ AssertionError: 1 != 2 0 0 - Detail + Detail - +
TestUploadEPubs - test_upload_epub_comments
@@ -4905,7 +5392,7 @@ AssertionError: 1 != 2 - +
TestUploadEPubs - test_upload_epub_cover
@@ -4914,7 +5401,7 @@ AssertionError: 1 != 2 - +
TestUploadEPubs - test_upload_epub_cover_formats
@@ -4923,7 +5410,7 @@ AssertionError: 1 != 2 - +
TestUploadEPubs - test_upload_epub_duplicate
@@ -4932,7 +5419,7 @@ AssertionError: 1 != 2 - +
TestUploadEPubs - test_upload_epub_identifier
@@ -4941,7 +5428,7 @@ AssertionError: 1 != 2 - +
TestUploadEPubs - test_upload_epub_lang
@@ -4951,21 +5438,21 @@ AssertionError: 1 != 2 - + TestUserList 18 - 17 - 1 + 18 + 0 0 0 - Detail + Detail - +
TestUserList - test_edit_user_email
@@ -4974,7 +5461,7 @@ AssertionError: 1 != 2 - +
TestUserList - test_list_visibility
@@ -4983,7 +5470,7 @@ AssertionError: 1 != 2 - +
TestUserList - test_user_list_admin_role
@@ -4992,7 +5479,7 @@ AssertionError: 1 != 2 - +
TestUserList - test_user_list_check_sort
@@ -5001,7 +5488,7 @@ AssertionError: 1 != 2 - +
TestUserList - test_user_list_denied_tags
@@ -5010,7 +5497,7 @@ AssertionError: 1 != 2 - +
TestUserList - test_user_list_download_role
@@ -5019,36 +5506,16 @@ AssertionError: 1 != 2 - +
TestUserList - test_user_list_edit_button
- -
- FAIL -
- - - - + PASS - +
TestUserList - test_user_list_edit_email
@@ -5057,7 +5524,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserList - test_user_list_edit_kindle
@@ -5066,7 +5533,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserList - test_user_list_edit_language
@@ -5075,7 +5542,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserList - test_user_list_edit_locale
@@ -5084,7 +5551,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserList - test_user_list_edit_name
@@ -5093,7 +5560,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserList - test_user_list_edit_visiblility
@@ -5102,7 +5569,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserList - test_user_list_guest_edit
@@ -5111,7 +5578,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserList - test_user_list_remove_admin
@@ -5120,7 +5587,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserList - test_user_list_requests
@@ -5129,7 +5596,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserList - test_user_list_search
@@ -5138,7 +5605,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserList - test_user_list_sort
@@ -5156,13 +5623,13 @@ AssertionError: False is not true : Press cancel in User edit leads not back to 0 0 - Detail + Detail - +
TestUserLoad - test_user_change_vis
@@ -5180,13 +5647,13 @@ AssertionError: False is not true : Press cancel in User edit leads not back to 0 0 - Detail + Detail - +
TestUserTemplate - test_allow_column_restriction
@@ -5195,7 +5662,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_allow_tag_restriction
@@ -5204,7 +5671,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_archived_format_template
@@ -5213,7 +5680,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_author_user_template
@@ -5222,7 +5689,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_best_user_template
@@ -5231,7 +5698,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_category_user_template
@@ -5240,7 +5707,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_deny_column_restriction
@@ -5249,7 +5716,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_deny_tag_restriction
@@ -5258,7 +5725,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_detail_random_user_template
@@ -5267,7 +5734,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_download_user_template
@@ -5276,7 +5743,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_format_user_template
@@ -5285,7 +5752,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_hot_user_template
@@ -5294,7 +5761,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_language_user_template
@@ -5303,7 +5770,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_limit_book_languages
@@ -5312,7 +5779,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_list_user_template
@@ -5321,7 +5788,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_publisher_user_template
@@ -5330,7 +5797,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_random_user_template
@@ -5339,7 +5806,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_read_user_template
@@ -5348,7 +5815,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_recent_user_template
@@ -5357,7 +5824,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_series_user_template
@@ -5366,7 +5833,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestUserTemplate - test_ui_language_settings
@@ -5379,18 +5846,18 @@ AssertionError: False is not true : Press cancel in User edit leads not back to TestCalibreWebVisibilitys 35 - 34 - 1 + 33 + 2 0 0 - Detail + Detail - +
TestCalibreWebVisibilitys - test_about
@@ -5399,7 +5866,7 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestCalibreWebVisibilitys - test_admin_SMTP_Settings
@@ -5408,26 +5875,209 @@ AssertionError: False is not true : Press cancel in User edit leads not back to - +
TestCalibreWebVisibilitys - test_admin_add_user
+ PASS + + + + + + +
TestCalibreWebVisibilitys - test_admin_change_password
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_admin_change_visibility_archived
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_admin_change_visibility_authors
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_admin_change_visibility_category
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_admin_change_visibility_file_formats
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_admin_change_visibility_hot
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_admin_change_visibility_language
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_admin_change_visibility_publisher
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_admin_change_visibility_random
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_admin_change_visibility_rated
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_admin_change_visibility_rating
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_admin_change_visibility_read
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_admin_change_visibility_series
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_allow_columns
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_allow_tags
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_archive_books
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_authors_max_settings
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_change_title
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_checked_logged_in
+ + PASS + + + + + + +
TestCalibreWebVisibilitys - test_hide_custom_column
+
- FAIL + FAIL
-