Skip to content

Commit

Permalink
feat: deep link to episode directly not show when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
dylandoamaral committed Aug 26, 2024
1 parent 12a3f3e commit 5614f9f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions custom_components/trakt_tv/models/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,14 +302,16 @@ def to_homeassistant(self) -> Dict[str, Any]:
episode = self.episode.number
episode = episode if episode >= 10 else f"0{episode}"

default = {
**default,
"episode": self.episode.title,
"number": f"S{season}E{episode}",
}
default["episode"] = self.episode.title
default["number"] = f"S{season}E{episode}"

if self.ids.slug is not None:
deep_link = f"https://trakt.tv/shows/{self.ids.slug}/seasons/{season}/episodes/{episode}"
default["deep_link"] = deep_link
else:
if self.ids.slug is not None:
default["deep_link"] = f"https://trakt.tv/shows/{self.ids.slug}"

if self.ids.slug is not None:
default["deep_link"] = f"https://trakt.tv/shows/{self.ids.slug}"
if self.trailer is not None:
default["trailer"] = self.trailer
if self.summary is not None:
Expand Down

0 comments on commit 5614f9f

Please sign in to comment.