From f11f91b9fcab3ebc0b661e01a2bd381c82c2e8a0 Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 19 Oct 2023 00:35:55 +0000 Subject: [PATCH] sane-bt-search: increase default result count 5 -> 12 --- pkgs/additional/sane-scripts/src/sane-bt-search | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/pkgs/additional/sane-scripts/src/sane-bt-search b/pkgs/additional/sane-scripts/src/sane-bt-search index bcc2af62..7bc8e514 100755 --- a/pkgs/additional/sane-scripts/src/sane-bt-search +++ b/pkgs/additional/sane-scripts/src/sane-bt-search @@ -6,15 +6,6 @@ usage: sane-bt-search [options] searches Jackett for torrent files matching the title. returns select results and magnet links. - -options: - --full display all results - --help show this help message and exit - --manga show only manga results - --h265 show only H.265 video (HEVC) - --json output one json document instead of a human-readable table - --top= show the top rated torrents (default: 5) - --verbose show more information, useful for debugging/development """ # about Jackett @@ -43,6 +34,8 @@ ENDPOINTS = dict( # results_torznab="api/v2.0/indexers/all/results/torznab" ) +DEFAULT_RESULT_COUNT = 12 + epoch = datetime(1970, 1, 1) logger = logging.getLogger(__name__) @@ -275,7 +268,7 @@ def main(args: list[str]): parser = argparse.ArgumentParser(description='search torrent trackers') parser.add_argument('--full', action='store_true', help='show all results') - parser.add_argument('--top', help='how many results to show (default: 5)') + parser.add_argument('--top', help=f'how many results to show (default: {DEFAULT_RESULT_COUNT})') parser.add_argument('--sort-by', default='seeders', help='how to rank matches (seeders, tracker)') parser.add_argument('--json', action='store_true', help='output results in json') parser.add_argument('--verbose', action='store_true') @@ -298,7 +291,7 @@ def main(args: list[str]): ordered_results = sort_results(filtered_results, args.sort_by) if not args.full: - ordered_results = ordered_results[:int(args.top or "5")] + ordered_results = ordered_results[:int(args.top or str(DEFAULT_RESULT_COUNT))] format_results(all_results, ordered_results, args.json)