Fix error when Series missing 'episodeFileCount' or 'episodeCount' (#15824)
* Fix error when Series missing 'episodeFileCount' or 'episodeCount' * Update sonarr.py * Update sonarr.pypull/15857/head
parent
9cfe0db3c8
commit
6031801206
|
@ -158,6 +158,10 @@ class SonarrSensor(Entity):
|
|||
)
|
||||
elif self.type == 'series':
|
||||
for show in self.data:
|
||||
if 'episodeFileCount' not in show \
|
||||
or 'episodeCount' not in show:
|
||||
attributes[show['title']] = 'N/A'
|
||||
else:
|
||||
attributes[show['title']] = '{}/{} Episodes'.format(
|
||||
show['episodeFileCount'], show['episodeCount'])
|
||||
elif self.type == 'status':
|
||||
|
|
Loading…
Reference in New Issue