From 74ec65c8a93ee122af9f0df0c85d6f68c349e881 Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 22 Jun 2023 22:32:38 +0000 Subject: [PATCH] sane-bt-show: allow showing multiple torrents (again) --- pkgs/additional/sane-scripts/src/sane-bt-show | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/additional/sane-scripts/src/sane-bt-show b/pkgs/additional/sane-scripts/src/sane-bt-show index dcf03dc8..79989a39 100755 --- a/pkgs/additional/sane-scripts/src/sane-bt-show +++ b/pkgs/additional/sane-scripts/src/sane-bt-show @@ -9,14 +9,15 @@ from sane_bt import MediaMeta, TransmissionApi def main(): parser = argparse.ArgumentParser() TransmissionApi.add_arguments(parser) - parser.add_argument("torrent", nargs="?", help="torrent id to show (acquire by first calling with no args)") + parser.add_argument("torrents", nargs="*", help="torrent id to show (acquire by first calling with no args)") args = parser.parse_args() bt_api = TransmissionApi.from_arguments(args) - torrent = args.torrent + torrents = args.torrents - if torrent: - print(bt_api.info(torrent)) + if torrents: + for t in torrents: + print(bt_api.info(t)) else: print(bt_api.list_())