Fix: Fallback to playing tracks if artist no have albums

This commit is contained in:
localhost_frssoft 2022-12-24 03:54:14 +03:00
parent c8af4ae6ea
commit ae3becd1e9

View File

@ -32,7 +32,12 @@ def list_artists(pg=None, search=None):
print('Search by artist:') print('Search by artist:')
list_artists(search=input()) list_artists(search=input())
else: 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): def play_artist(artist_id):