From c36474a2f09afc52254f5b9a875494a0f7361aec Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sat, 1 Jul 2023 16:12:36 +1000 Subject: [PATCH] fixed BUG-34: possible series list is assuming a NULL sub_book_num is taking up a slot of books in series --- BUGs | 2 -- series.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/BUGs b/BUGs index 3dcedf5..5bd8927 100644 --- a/BUGs +++ b/BUGs @@ -11,5 +11,3 @@ BUG-31: series does not have 'series_num', so a book in 2 series, means he o a larger one, and numbering implies the inner (smaller number), and outer has explicity overall ordering of books in both series, so should be ok? - -BUG-34: possible series list is assuming a NULL sub_book_num is taking up a slot of books in series diff --git a/series.py b/series.py index 605f916..3b55d65 100644 --- a/series.py +++ b/series.py @@ -49,7 +49,7 @@ def CalcAvgRating(sid): def ListOfSeriesWithMissingBooks(): with db.engine.connect() as conn: - res=conn.exec_driver_sql( "select id, title, num_books, count from ( select s.id, s.title, s.num_books, count(bsl.book_id) from series s left outer join book_series_link bsl on bsl.series_id=s.id group by s.id) as foo where num_books > count") + res=conn.exec_driver_sql( "select id, title, num_books, count from ( select s.id, s.title, s.num_books, count(bsl.book_id) from series s left outer join book_series_link bsl on bsl.series_id=s.id where bsl.book_num is not null group by s.id) as foo where num_books > count") tmp=[] for row in res: tmp.append({'id': row[0], 'title': row[1]})