From 9b5011485285575b4d12e2aac7e7e6d0944a4aa7 Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Sat, 2 Jan 2021 07:51:48 +0100 Subject: [PATCH] Fixes from testrun --- cps/render_template.py | 2 +- cps/web.py | 5 +- test/Calibre-Web TestSummary_Linux.html | 9339 ++++------------------- 3 files changed, 1326 insertions(+), 8020 deletions(-) diff --git a/cps/render_template.py b/cps/render_template.py index fb0b5067..16fdab13 100644 --- a/cps/render_template.py +++ b/cps/render_template.py @@ -104,7 +104,7 @@ def get_readbooks_ids(): readBooks = calibre_db.session.query(db.cc_classes[config.config_read_column])\ .filter(db.cc_classes[config.config_read_column].value == True).all() return frozenset([x.book for x in readBooks]) - except KeyError: + except (KeyError, AttributeError): log.error("Custom Column No.%d is not existing in calibre database", config.config_read_column) return [] diff --git a/cps/web.py b/cps/web.py index 6d993e29..8a52f97a 100644 --- a/cps/web.py +++ b/cps/web.py @@ -616,13 +616,12 @@ def render_read_books(page, are_read, as_xml=False, order=None): db_filter = and_(ub.ReadBook.user_id == int(current_user.id), ub.ReadBook.read_status == ub.ReadBook.STATUS_FINISHED) else: - db_filter = and_(ub.ReadBook.user_id == int(current_user.id), - coalesce(ub.ReadBook.read_status, 0) != ub.ReadBook.STATUS_FINISHED) + db_filter = coalesce(ub.ReadBook.read_status, 0) != ub.ReadBook.STATUS_FINISHED entries, random, pagination = calibre_db.fill_indexpage(page, 0, db.Books, db_filter, order, - ub.ReadBook, db.Books.id==ub.ReadBook.book_id) + ub.ReadBook, db.Books.id == ub.ReadBook.book_id) else: try: if are_read: diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index dde602ab..a2fbfe1a 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2020-12-12 12:19:43

+

Start Time: 2021-01-01 20:50:20

-

Stop Time: 2020-12-12 14:23:09

+

Stop Time: 2021-01-02 02:07:39

-

Duration: 1h 33 min

+

Duration: 4h 51 min

@@ -234,209 +234,82 @@ - - _ErrorHolder - 29 - 0 + + TestCli + 8 + 7 0 - 29 0 + 1 - Detail + Detail - + -
tearDownClass (test_anonymous)
- - -
- ERROR -
- - - +
TestCli - test_already_started
+ PASS - + -
tearDownClass (test_cli)
- - -
- ERROR -
- - - +
TestCli - test_bind_to_single_interface
+ PASS - + -
tearDownClass (test_cover_edit_books)
- - -
- ERROR -
- - - +
TestCli - test_cli_SSL_files
+ PASS - + -
tearDownClass (test_delete_database)
- - -
- ERROR -
- - - +
TestCli - test_cli_different_folder
+ PASS - + -
tearDownClass (test_ebook_convert)
- - -
- ERROR -
- - - +
TestCli - test_cli_different_settings_database
+ PASS - + -
tearDownClass (test_ebook_convert_gdrive)
+
TestCli - test_cli_gdrive_location
- ERROR + SKIP
-