From: Oleg Broytman Date: Sun, 21 Feb 2021 17:30:51 +0000 (+0300) Subject: Feat: Order books by date descending X-Git-Tag: 0.1.6~14 X-Git-Url: https://git.phdru.name/?p=m_librarian.git;a=commitdiff_plain;h=eccf120322c43466764ab11dfa28db008543995e Feat: Order books by date descending [skip ci] --- 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())