fixed BUG-34: possible series list is assuming a NULL sub_book_num is taking up a slot of books in series

This commit is contained in:
2023-07-01 16:12:36 +10:00
parent f8df4d1980
commit c36474a2f0
2 changed files with 1 additions and 3 deletions

2
BUGs
View File

@@ -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 a larger one, and numbering implies the inner (smaller number), and
outer has explicity overall ordering of books in both series, so outer has explicity overall ordering of books in both series, so
should be ok? should be ok?
BUG-34: possible series list is assuming a NULL sub_book_num is taking up a slot of books in series

View File

@@ -49,7 +49,7 @@ def CalcAvgRating(sid):
def ListOfSeriesWithMissingBooks(): def ListOfSeriesWithMissingBooks():
with db.engine.connect() as conn: 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=[] tmp=[]
for row in res: for row in res:
tmp.append({'id': row[0], 'title': row[1]}) tmp.append({'id': row[0], 'title': row[1]})