Radio name playing

This commit is contained in:
localhost_frssoft 2022-11-07 14:36:02 +03:00
parent 9d1e9b149c
commit 2daed6599b
1 changed files with 4 additions and 3 deletions

View File

@ -38,7 +38,8 @@ def list_radios():
else: else:
id_selected = selected[0] id_selected = selected[0]
id_radio = results[int(id_selected)].get('id') id_radio = results[int(id_selected)].get('id')
radio_load(id_radio) name_radio = results[int(id_selected)].get('name')
radio_load(id_radio, name=name_radio)
def radio_generator(radio_session_id): def radio_generator(radio_session_id):
@ -55,7 +56,7 @@ def radio_generator(radio_session_id):
radio_event_gen = threading.Event() radio_event_gen = threading.Event()
def radio_load(id_radio=None, type_radio='custom'): def radio_load(id_radio=None, type_radio='custom', name=None):
requested_radio = { requested_radio = {
'custom_radio': id_radio, 'custom_radio': id_radio,
'radio_type': type_radio, 'radio_type': type_radio,
@ -71,7 +72,7 @@ def radio_load(id_radio=None, type_radio='custom'):
radio_task.start() radio_task.start()
while True: while True:
try: try:
select = fzf.prompt(('Next', 'Prev', 'Pause', 'Download', 'Exit'), f'--header=\'Radio playing...\'')[0] select = fzf.prompt(('Next', 'Prev', 'Pause', 'Download', 'Exit'), f"--header=\'Radio {name} playing...\'")[0]
if select == 'Next': if select == 'Next':
radio_get_track(radio_session_id) radio_get_track(radio_session_id)
player.playlist_next() player.playlist_next()