Update sonarr sensor (#71576)

Fixed issue when episodeFileCount/episodeCount might not exist
pull/71845/head
Clifford W. Hansen 2022-05-14 05:09:09 +02:00 committed by GitHub
parent d84c6af55d
commit ef9d8944f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -237,7 +237,7 @@ class SonarrSensor(SonarrEntity, SensorEntity):
stats = item.statistics
attrs[
item.title
] = f"{stats.episodeFileCount}/{stats.episodeCount} Episodes"
] = f"{getattr(stats,'episodeFileCount', 0)}/{getattr(stats, 'episodeCount', 0)} Episodes"
elif key == "upcoming" and self.data.get(key) is not None:
for episode in self.data[key]:
identifier = f"S{episode.seasonNumber:02d}E{episode.episodeNumber:02d}"