From 2b3e5b9212438b1a7f76c6289205e15a50b9360c Mon Sep 17 00:00:00 2001 From: "Michael K. Avanessian" Date: Sun, 31 Mar 2024 19:01:19 -0700 Subject: [PATCH] Fixed deep_link url to use 'titleSlug' instead of just 'title' for better reliability --- custom_components/sonarr_upcoming_media/sensor.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/custom_components/sonarr_upcoming_media/sensor.py b/custom_components/sonarr_upcoming_media/sensor.py index 894aa6a..24118b6 100644 --- a/custom_components/sonarr_upcoming_media/sensor.py +++ b/custom_components/sonarr_upcoming_media/sensor.py @@ -132,10 +132,9 @@ def extra_state_attributes(self): card_item['fanart'] = re.sub('.jpg', '_t.jpg', img['remoteUrl']) except: pass - series_title = show['series']['title'] - series_slug = series_title.lower().replace(' ', '-') + series_title_slug = show['series']['titleSlug'] protocol = 'https' if self.ssl else 'http' - card_item['deep_link'] = f'{protocol}://{self.host}:{self.port}/series/{series_slug}' + card_item['deep_link'] = f'{protocol}://{self.host}:{self.port}/series/{series_title_slug}' card_json.append(card_item) attributes['data'] = card_json return attributes