final books on shelf fix, start out by title, so books not in series are by title (and those in and out of series are by title until a series is reached, then its by series number until the series is finished, then back to title)

This commit is contained in:
2023-06-11 15:36:39 +10:00
parent 9f5e9ff3c2
commit 48c2c564d3

View File

@@ -814,8 +814,12 @@ def rem_parent_books_from_series(pid):
@app.route("/books_on_shelf", methods=["GET"]) @app.route("/books_on_shelf", methods=["GET"])
@login_required @login_required
def books_on_shelf(): def books_on_shelf():
# start with all books owned, but it includes sub-books, so remove them... # start with basic sort by title (we will sort by author at the end) in javascript,
books = Book.query.join(Owned).filter(Owned.name=='Currently Owned').all() # also re-order this list to deal with series ordering - this will leave overall sort by
# author, title & the moment we hit a series, the rest of those books are ordered by series
# start with all books owned by title, but it includes sub-books, so remove them...
books = Book.query.join(Owned).filter(Owned.name=='Currently Owned').order_by(Book.title).all()
RemSubs(books) RemSubs(books)
# because a book can be in multiple series, without any ordering we need to find # because a book can be in multiple series, without any ordering we need to find