From eccf120322c43466764ab11dfa28db008543995e Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 21 Feb 2021 20:30:51 +0300 Subject: [PATCH] Feat: Order books by date descending [skip ci] --- m_librarian/web/app.py | 2 +- scripts/ml-search.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/m_librarian/web/app.py b/m_librarian/web/app.py index d34b9df..78878a1 100644 --- a/m_librarian/web/app.py +++ b/m_librarian/web/app.py @@ -79,7 +79,7 @@ def books_by_author(id): join_expressions.append(Book.j.authors) join_expressions.append(Author.q.id == id) books = search_books('full', None, {}, join_expressions, - orderBy=('series', 'ser_no', 'title'), + orderBy=('series', 'ser_no', 'title', '-date'), use_filters=use_filters) return { 'author': Author.get(id), diff --git a/scripts/ml-search.py b/scripts/ml-search.py index 24db982..20440bf 100755 --- a/scripts/ml-search.py +++ b/scripts/ml-search.py @@ -153,7 +153,7 @@ def _search_books(case_sensitive, search_type, args): Language, search_type, case_sensitive, lvalues) join_expressions.extend(conditions) books = search_books(search_type, case_sensitive, values, join_expressions, - orderBy=('series', 'ser_no', 'title'), + orderBy=('series', 'ser_no', 'title', '-date'), use_filters=args.filters) if args.count: print_count(books.count()) -- 2.39.5