From 3327ec41c6b9ab3c2fee3abc0ce001099db5fbba Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Sat, 10 Jun 2023 22:53:51 +0300 Subject: [PATCH] reduce menu if connection failed --- funkwhale_cli.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/funkwhale_cli.py b/funkwhale_cli.py index 9c1ae8c..ec4dc80 100755 --- a/funkwhale_cli.py +++ b/funkwhale_cli.py @@ -25,6 +25,16 @@ def main(): while True: support_message = '' instance_title = '' + menu = ['Radios', + 'Artists', + 'Albums', + 'Tracks', + 'Channels', + 'Playlists', + 'Favorites', + 'Recently listened', + 'Search', + 'Switch instance'] try: ins_settings = get_instance_settings() for i in ins_settings: @@ -36,17 +46,8 @@ def main(): except: time.sleep(1) main_menu_header = quote(f'''Connection failed'''.strip()) + menu = ['Switch instance'] - menu = ['Radios', - 'Artists', - 'Albums', - 'Tracks', - 'Channels', - 'Playlists', - 'Favorites', - 'Recently listened', - 'Search', - 'Switch instance'] if not current_instance.s.headers.get('Authorization'): menu.append('Sign in') if support_message != '':