diff --git a/main.py b/main.py index dfd755f..d3314fb 100644 --- a/main.py +++ b/main.py @@ -814,8 +814,12 @@ def rem_parent_books_from_series(pid): @app.route("/books_on_shelf", methods=["GET"]) @login_required def books_on_shelf(): - # start with all books owned, but it includes sub-books, so remove them... - books = Book.query.join(Owned).filter(Owned.name=='Currently Owned').all() + # start with basic sort by title (we will sort by author at the end) in javascript, + # 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) # because a book can be in multiple series, without any ordering we need to find