Closed jeffc closed 5 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
cac06ae
) 100.00% compared to head (cf98933
) 100.00%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks @jeffc !
Fix a bug where home assistant media browser fails to load clips if any have a
top_score
of zero.The errors look like this:
This was mostly fixed in this commit, but python evaluates
(0 or None)
asNone
(interestingly, it evaluates(None or 0)
as0
). This means that ifevent['top_score']
is0
(which can happen if you create the event through an API call, for instance... that's how I found this bug) andevent['data'].get('top_score')
isNone
, the expression evaluates toint(None * 100)
, which causes the error.This fixes it by adding a default case of 0.
My event that triggered this bug, as reported by
/api/events?limit=50&has_clip=1&include_thumbnails=0
: