Skip to content

Commit

Permalink
Fix issue with missing 'value' key in 'ratings' dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
mkanet committed May 21, 2024
1 parent d73620c commit 51cc791
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/radarr_upcoming_media/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def parse_data(inData, tz, host, port, ssl, theaters):
card_item['studio'] = movie.get('studio', '')
card_item['genres'] = movie.get('genres', '')

if 'ratings' in movie and movie['ratings'].get('value', 0) > 0:
if 'ratings' in movie and movie['ratings'] and movie['ratings'].get('value', 0) > 0:
card_item['rating'] = ('\N{BLACK STAR} ' + str(movie['ratings']['value']))
else:
card_item['rating'] = ''
Expand Down

0 comments on commit 51cc791

Please sign in to comment.