Skip to content

Commit b9968f8

Browse files
committed
Handle if image is None
1 parent 79525ce commit b9968f8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

custom_components/mass_queue/actions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ def _format_queue_item(self, queue_item: dict) -> dict:
130130
else:
131131
media_album_name = media_album.get('name', '')
132132
media_content_id = media['uri']
133-
if 'image' in queue_item:
134-
img = queue_item['image']
135-
media_image = img.get('path')
136-
else:
133+
img = queue_item.get('image')
134+
if image is None:
137135
media_image = ''
136+
else:
137+
media_image = img.get('path', '')
138138

139139
artists = media['artists']
140140
artist_names = [artist['name'] for artist in artists]

0 commit comments

Comments
 (0)