]> git.phdru.name Git - m_librarian.git/commitdiff
Feat: Order books by date descending
authorOleg Broytman <phd@phdru.name>
Sun, 21 Feb 2021 17:30:51 +0000 (20:30 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 21 Feb 2021 17:36:02 +0000 (20:36 +0300)
[skip ci]

m_librarian/web/app.py
scripts/ml-search.py

index d34b9df64f83fc6b8521af7364e5b5b19927a67b..78878a11df47845d740ac6af025779e8e343f5f8 100644 (file)
@@ -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),
index 24db982fafb1b4cf80ef45741e0ec1d5b76380f5..20440bfa8a394dfb5fd0b2162e09d45d0dbc7f3d 100755 (executable)
@@ -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())