From 5509d4598bbad41c6d9d0b1221d37962166c2b06 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Wed, 30 Aug 2023 20:23:40 +0200 Subject: [PATCH] Bugfix for showing series coatining only one book in list view containing having this book no series_index value set --- cps/web.py | 2 +- test/Calibre-Web TestSummary_Linux.html | 287 ++++++++++-------------- 2 files changed, 123 insertions(+), 166 deletions(-) diff --git a/cps/web.py b/cps/web.py index 95b1222c..4430dd90 100755 --- a/cps/web.py +++ b/cps/web.py @@ -1014,7 +1014,7 @@ def series_list(): func.max(db.Books.series_index), db.Books.id) .join(db.books_series_link).join(db.Series).filter(calibre_db.common_filters()) .group_by(text('books_series_link.series')) - .having(func.max(db.Books.series_index)) + .having(or_(func.max(db.Books.series_index), db.Books.series_index=="")) .order_by(order) .all()) return render_title_template('grid.html', entries=entries, folder='web.books_list', charlist=char_list, diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index b6ed61e8..808dca76 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2023-08-28 19:42:24

+

Start Time: 2023-08-29 20:07:04

-

Stop Time: 2023-08-29 02:13:03

+

Stop Time: 2023-08-30 02:37:10

-

Duration: 5h 31 min

+

Duration: 5h 30 min

@@ -102,12 +102,12 @@ - + TestAnonymous 13 - 12 + 13 + 0 0 - 1 0 Detail @@ -197,31 +197,11 @@ - +
TestAnonymous - test_guest_change_visibility_series
- -
- ERROR -
- - - - + PASS @@ -254,12 +234,12 @@ IndexError: list index out of range - + TestBackupMetadata 22 - 21 + 19 1 - 0 + 2 0 Detail @@ -277,11 +257,42 @@ IndexError: list index out of range - +
TestBackupMetadata - test_backup_change_book_author
- PASS + +
+ FAIL +
+ + + + @@ -313,35 +324,30 @@ IndexError: list index out of range - +
TestBackupMetadata - test_backup_change_book_publisher
- PASS - - - - - - -
TestBackupMetadata - test_backup_change_book_publishing_date
-
- FAIL + ERROR
-
Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/test/test_edit_books_list.py", line 184, in test_bookslist_edit_series
+  File "/home/ozzie/Development/calibre-web-test/test/test_edit_books_list.py", line 185, in test_bookslist_edit_series
     self.assertEqual(3, len(elements))
-AssertionError: 3 != 2
+AssertionError: 3 != 4
@@ -2012,12 +2051,12 @@ AssertionError: 3 != 2 - + TestLoadMetadata 1 0 - 1 0 + 1 0 Detail @@ -2026,26 +2065,26 @@ AssertionError: 3 != 2 - +
TestLoadMetadata - test_load_metadata
- FAIL + ERROR
-