From ae3becd1e97a58112cf33d9358d740034b540367 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Sat, 24 Dec 2022 03:54:14 +0300 Subject: [PATCH] Fix: Fallback to playing tracks if artist no have albums --- src/fw_artists.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fw_artists.py b/src/fw_artists.py index e958c56..ee52755 100644 --- a/src/fw_artists.py +++ b/src/fw_artists.py @@ -32,7 +32,12 @@ def list_artists(pg=None, search=None): print('Search by artist:') list_artists(search=input()) else: - list_albums(albums=artists_results[int(select)].get('albums')) + albums = artists_results[int(select)].get('albums') + if albums: + list_albums(albums=albums) + else: # Fallback on tracks of selected artist + play_artist(artists_results[int(select)]['id']) + def play_artist(artist_id):