From fa58dde080977056e17e0ee44a1d122c24fa6cdf Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Wed, 30 Nov 2022 03:33:14 +0300 Subject: [PATCH] Added radio by tag --- src/fw_radios.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/fw_radios.py b/src/fw_radios.py index 86f9903..7c4bb8d 100644 --- a/src/fw_radios.py +++ b/src/fw_radios.py @@ -1,5 +1,6 @@ from src.fw_api import s, get_radios, post_radio_session, get_track_radio, list_libraries, favorite_track, get_audio_file from src.fw_libraries import libraries +from src.fw_tags import list_tags from src.utils import download_track from src.mpv_control import player, track_url_to_uuid from src.settings import get_config @@ -31,14 +32,14 @@ def list_radios(): if s.headers.get('Authorization'): # Radios avalaible only for auth user view.append('Favourites') view.append('Less listened') - view.append('Random') - view.append('Libraries') - view.append('Users') - view.append('Recently Added') + view.extend(['Tag', 'Random', 'Libraries', 'Users', 'Recently Added']) selected = fzf.prompt(view, f'--header \'Found {count} radios\' --read0', delimiter="\0")[0].split('.', 1) if 'Favourites' in selected: radio_load(id_radio, 'favorites', name='your favorites tracks') + elif 'Tag' in selected: + tag = list_tags() + radio_load(type_radio='tag', name=f'Radio by tag: {tag}', related_object=tag) elif 'Random' in selected: radio_load(id_radio, 'random', name='totally random') elif 'Libraries' in selected: