From 12a02ab6be68df70638040a5699977923145e461 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Tue, 15 Nov 2022 02:14:01 +0300 Subject: [PATCH] Check avalaiblity artist in albums --- src/fw_albums.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fw_albums.py b/src/fw_albums.py index 93a3942..a739842 100644 --- a/src/fw_albums.py +++ b/src/fw_albums.py @@ -34,9 +34,10 @@ def list_albums(albums=None, pg=None, search=None, artist=None, include_channels for i in albums_results: index = albums_results.index(i) album_name = i.get('title') - artist_name = i.get('artist').get('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}' view.append(f'{option_str}') select = fzf.prompt(view)[0].split('.', 1)[0]