Check avalaiblity artist in albums

This commit is contained in:
localhost_frssoft 2022-11-15 02:14:01 +03:00
parent 5556a0c3de
commit 12a02ab6be

View File

@ -34,9 +34,10 @@ def list_albums(albums=None, pg=None, search=None, artist=None, include_channels
for i in albums_results: for i in albums_results:
index = albums_results.index(i) index = albums_results.index(i)
album_name = i.get('title') album_name = i.get('title')
artist_name = i.get('artist').get('name')
option_str = f'{index}.{album_name}' option_str = f'{index}.{album_name}'
if show_artist_name_in_albums: artist_name = i.get('artist')
if show_artist_name_in_albums and isinstance(artist_name, dict):
artist_name = artist_name.get('name')
option_str += f' | Artist: {artist_name}' option_str += f' | Artist: {artist_name}'
view.append(f'{option_str}') view.append(f'{option_str}')
select = fzf.prompt(view)[0].split('.', 1)[0] select = fzf.prompt(view)[0].split('.', 1)[0]