sane-bt-show: allow showing multiple torrents (again)
This commit is contained in:
parent
21a060d856
commit
74ec65c8a9
|
@ -9,14 +9,15 @@ from sane_bt import MediaMeta, TransmissionApi
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
TransmissionApi.add_arguments(parser)
|
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()
|
args = parser.parse_args()
|
||||||
bt_api = TransmissionApi.from_arguments(args)
|
bt_api = TransmissionApi.from_arguments(args)
|
||||||
torrent = args.torrent
|
torrents = args.torrents
|
||||||
|
|
||||||
if torrent:
|
if torrents:
|
||||||
print(bt_api.info(torrent))
|
for t in torrents:
|
||||||
|
print(bt_api.info(t))
|
||||||
else:
|
else:
|
||||||
print(bt_api.list_())
|
print(bt_api.list_())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user