X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=scripts%2Fml-search.py;h=7e6c9da3b793c02df82ea5d8570635258427a31a;hb=5ccddf723234cfc741f767c903f95615e8f41e45;hp=5cc0bc4a1b1a24aab281389f77f018be3cd67b59;hpb=8fdf6aab492482fcacad9ce2ec764bdc5bf76590;p=m_librarian.git diff --git a/scripts/ml-search.py b/scripts/ml-search.py index 5cc0bc4..7e6c9da 100755 --- a/scripts/ml-search.py +++ b/scripts/ml-search.py @@ -4,6 +4,7 @@ from __future__ import print_function import argparse import os import sys + from sqlobject.sqlbuilder import CONCAT from m_lib.defenc import default_encoding @@ -153,7 +154,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()) @@ -203,8 +204,7 @@ def _search_books(case_sensitive, search_type, args): if args.get or args.get_many: download_to = args.download_to if download_to is None: - download_to = get_config().get('download', 'path') \ - or os.path.curdir + download_to = get_config().getpath('download', 'path') download(book, download_to, args.path, args.format) count += 1 print_count(count) @@ -378,7 +378,7 @@ if __name__ == '__main__': if int(args.start) + int(args.substring) + int(args.full) > 1: sys.stderr.write( - "Cannot search case sensitive and case insensitive " + "Cannot search from start, substring and full " "at the same time\n") main_parser.print_help() sys.exit(1)