reduce menu if connection failed

This commit is contained in:
localhost_frssoft 2023-06-10 22:53:51 +03:00
parent 706d7684dd
commit 3327ec41c6

View File

@ -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 != '':