From 2daed6599b394f42c082947d86b610f3e9109fc0 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Mon, 7 Nov 2022 14:36:02 +0300 Subject: [PATCH] Radio name playing --- src/fw_radios.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fw_radios.py b/src/fw_radios.py index f94a416..b56d64f 100644 --- a/src/fw_radios.py +++ b/src/fw_radios.py @@ -38,7 +38,8 @@ def list_radios(): else: id_selected = selected[0] 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): @@ -55,7 +56,7 @@ def radio_generator(radio_session_id): 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 = { 'custom_radio': id_radio, 'radio_type': type_radio, @@ -71,7 +72,7 @@ def radio_load(id_radio=None, type_radio='custom'): radio_task.start() while True: 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': radio_get_track(radio_session_id) player.playlist_next()