From 607b0d2795139a77cb5c03cae655e360d5d7b037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Charette?= Date: Sat, 5 Dec 2020 19:00:30 +0100 Subject: [PATCH] Improve interactive behavior --- main.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index f79b612..b8bff80 100644 --- a/main.py +++ b/main.py @@ -117,18 +117,21 @@ def interactive(Qz, path, limit, tracks=True): title = ( "Select [space] the item(s) you want to download " - "(one or more)\nPress Ctrl + c to quit\n" + "(zero or more)\nPress Ctrl + c to quit\n" ) Selected = pick( - start.Total, title, multiselect=True, min_selection_count=1 + start.Total, title, multiselect=True, min_selection_count=0 ) - Albums.append(Selected) + if len(Selected) > 0: + Albums.append(Selected) - y_n = pick( - ["Yes", "No"], - "Items were added to queue to be downloaded. Keep searching?", - ) - if y_n[0][0] == "N": + y_n = pick( + ["Yes", "No"], + "Items were added to queue to be downloaded. Keep searching?", + ) + if y_n[0][0] == "N": + break + else: break desc = (