From 9b520b194110e1b374099f8ed1792af3b71ab559 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 4 Aug 2024 07:12:22 +0200 Subject: [PATCH] Fix archiving bookm for kobo sync Fix back function without search parameter Updated Testresults --- cps/static/js/main.js | 3 + cps/web.py | 6 +- setup.cfg | 7 +- test/Calibre-Web TestSummary_Linux.html | 1368 +++++++++-------------- 4 files changed, 530 insertions(+), 854 deletions(-) diff --git a/cps/static/js/main.js b/cps/static/js/main.js index fc18890c..72f01867 100644 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -171,6 +171,9 @@ $("#back").click(function() { } sessionStorage.removeItem("back"); sessionStorage.removeItem("search"); + if (param === null) { + param = ""; + } window.location.href = loc + param; }); diff --git a/cps/web.py b/cps/web.py index 2519ebd5..f43cdd87 100644 --- a/cps/web.py +++ b/cps/web.py @@ -183,9 +183,9 @@ def toggle_read(book_id): @web.route("/ajax/togglearchived/", methods=['POST']) @user_login_required def toggle_archived(book_id): - is_archived = change_archived_books(book_id, message="Book {} archive bit toggled".format(book_id)) - if is_archived: - remove_synced_book(book_id) + change_archived_books(book_id, message="Book {} archive bit toggled".format(book_id)) + # Remove book from syncd books list to force resync (?) + remove_synced_book(book_id) return "" diff --git a/setup.cfg b/setup.cfg index 5e0882e8..26eef25d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -38,11 +38,9 @@ console_scripts = [options] include_package_data = True install_requires = - Werkzeug<3.0.0 APScheduler>=3.6.3,<3.11.0 Babel>=1.3,<3.0 Flask-Babel>=0.11.1,<4.1.0 - Flask-Login>=0.3.2,<0.6.4 Flask-Principal>=0.3.2,<0.5.1 Flask>=1.0.2,<3.1.0 iso-639>=0.4.5,<0.5.0 @@ -57,10 +55,11 @@ install_requires = flask-wtf>=0.14.2,<1.3.0 chardet>=3.0.0,<4.1.0 advocate>=1.0.0,<1.1.0 - Flask-Limiter>=2.3.0,<3.6.0 + Flask-Limiter>=2.3.0,<3.9.0 regex>=2022.3.2,<2024.6.25 bleach>=6.0.0,<6.2.0 python-magic>=0.4.27,<0.5.0 + flask-httpAuth>=4.4.0,<5.0.0 [options.packages.find] @@ -105,5 +104,5 @@ comics = natsort>=2.2.0,<8.5.0 comicapi>=2.2.0,<3.3.0 kobo = - jsonschema>=3.2.0,<4.23.0 + jsonschema>=3.2.0,<4.24.0 diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index 6f805974..3bd3a93d 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2024-08-02 21:21:17

+

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

-

Stop Time: 2024-08-03 04:29:18

+

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

-

Duration: 5h 53 min

+

Duration: 6h 17 min

@@ -702,12 +702,12 @@ - + TestEbookConvertCalibre 15 - 12 - 2 - 1 + 15 + 0 + 0 0 Detail @@ -716,33 +716,11 @@ - +
TestEbookConvertCalibre - test_calibre_log
- -
- FAIL -
- - - - + PASS @@ -774,31 +752,11 @@ AssertionError: 1 != 2 - +
TestEbookConvertCalibre - test_convert_only
- -
- ERROR -
- - - - + PASS @@ -848,33 +806,11 @@ IndexError: list index out of range - +
TestEbookConvertCalibre - test_email_only
- -
- FAIL -
- - - - + PASS @@ -916,12 +852,12 @@ AssertionError: 1 != 2 - + TestEbookConvertCalibreGDrive 7 - 3 - 3 - 1 + 7 + 0 + 0 0 Detail @@ -930,95 +866,29 @@ AssertionError: 1 != 2 - +
TestEbookConvertCalibreGDrive - test_convert_email
- -
- FAIL -
- - - - + PASS - +
TestEbookConvertCalibreGDrive - test_convert_failed_and_email
- -
- ERROR -
- - - - + PASS - +
TestEbookConvertCalibreGDrive - test_convert_only
- -
- FAIL -
- - - - + PASS @@ -1041,33 +911,11 @@ AssertionError: 1 != 0 - +
TestEbookConvertCalibreGDrive - test_email_only
- -
- FAIL -
- - - - + PASS @@ -1082,12 +930,12 @@ AssertionError: 1 != 2 - + TestEbookConvertKepubify 3 - 2 + 3 + 0 0 - 1 0 Detail @@ -1105,31 +953,11 @@ AssertionError: 1 != 2 - +
TestEbookConvertKepubify - test_convert_only
- -
- ERROR -
- - - - + PASS @@ -1184,11 +1012,11 @@ IndexError: list index out of range
Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_kepubify_gdrive.py", line 212, in test_convert_only
+  File "/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_kepubify_gdrive.py", line 239, in test_convert_only
     task_len, ret = self.wait_tasks(tasks, 1)
   File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 1636, in wait_tasks
     self.assertEqual(expected, task_len)
-AssertionError: 1 != 0
+AssertionError: 1 != 3
@@ -2378,8 +2206,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 90, in test_load_metadata
-    elif len(results)>19 and 'https://amazon.com/' == results[20]['source']:
+  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']:
 IndexError: list index out of range
@@ -2391,12 +2219,12 @@ IndexError: list index out of range - + TestEditBooksOnGdrive 18 - 16 + 18 + 0 0 - 2 0 Detail @@ -2459,86 +2287,20 @@ IndexError: list index out of range - +
TestEditBooksOnGdrive - test_edit_custom_float
- -
- ERROR -
- - - - + PASS - +
TestEditBooksOnGdrive - test_edit_custom_int
- -
- ERROR -
- - - - + PASS @@ -2634,11 +2396,11 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - + TestLoadMetadataScholar 1 - 1 0 + 1 0 0 @@ -2648,21 +2410,41 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - +
TestLoadMetadataScholar - test_load_metadata
- PASS + +
+ FAIL +
+ + + + - + TestSTARTTLS 3 - 3 - 0 + 2 + 1 0 0 @@ -2672,11 +2454,33 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - +
TestSTARTTLS - test_STARTTLS
- PASS + +
+ FAIL +
+ + + + @@ -2700,12 +2504,12 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - + TestSSL 7 - 3 - 1 - 3 + 7 + 0 + 0 0 Detail @@ -2741,201 +2545,38 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - +
TestSSL - test_SSL_non_admin_user
- -
- FAIL -
- - - - + PASS - +
TestSSL - test_SSL_only
- -
- ERROR -
- - - - + PASS - +
TestSSL - test_email_limit
- -
- ERROR -
- - - - + PASS - +
TestSSL - test_filepicker_two_file
- -
- ERROR -
- - - - - - - - - - - _ErrorHolder - 1 - 0 - 0 - 1 - 0 - - Detail - - - - - - - -
tearDownClass (test_email_ssl)
- - -
- ERROR -
- - - - + PASS @@ -2949,13 +2590,13 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 0 0 - Detail + Detail - +
TestEmbedMetadata - test_convert_file_embed_metadata
@@ -2964,7 +2605,7 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - +
TestEmbedMetadata - test_convert_kepub_embed_metadata
@@ -2973,7 +2614,7 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - +
TestEmbedMetadata - test_download_check_metadata
@@ -2982,7 +2623,7 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - +
TestEmbedMetadata - test_download_kepub_embed_metadata
@@ -2991,7 +2632,7 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - +
TestEmbedMetadata - test_download_permissions_missing_file
@@ -3000,7 +2641,7 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - +
TestEmbedMetadata - test_email_epub_embed_metadata
@@ -3018,13 +2659,13 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 0 0 - Detail + Detail - +
TestEmbedMetadataGdrive - test_convert_file_embed_metadata
@@ -3033,7 +2674,7 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - +
TestEmbedMetadataGdrive - test_convert_kepub_embed_metadata
@@ -3042,7 +2683,7 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - +
TestEmbedMetadataGdrive - test_download_check_metadata
@@ -3051,7 +2692,7 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - +
TestEmbedMetadataGdrive - test_download_kepub_embed_metadata
@@ -3069,13 +2710,13 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 0 0 - Detail + Detail - +
TestBookDatabase - test_invalid_book_path
@@ -3093,13 +2734,13 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 0 0 - Detail + Detail - +
TestErrorReadColumn - test_invalid_custom_column
@@ -3108,7 +2749,7 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - +
TestErrorReadColumn - test_invalid_custom_read_column
@@ -3126,13 +2767,13 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 0 1 - Detail + Detail - +
TestFilePicker - test_filepicker_limited_file
@@ -3141,19 +2782,19 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - +
TestFilePicker - test_filepicker_new_file
- SKIP + SKIP
-