diff options
| author | adavier <30839200+adavier@users.noreply.github.com> | 2022-01-07 19:37:08 +0000 |
|---|---|---|
| committer | adavier <30839200+adavier@users.noreply.github.com> | 2022-01-07 19:47:36 +0000 |
| commit | 9574d13059357f61af9ee7beda05448099cf2c39 (patch) | |
| tree | 7b742ba7a63eaf69dd80e3b8804f267938a1003b | |
| parent | 565ebbb643030f588077e9c28f13c8d9ec2afcce (diff) | |
Implement trakt episode links using the implementation from Series.cs
The code is the same as `MediaBrowser.Controller/Entities/TV/Series.cs`, using the imdbID to generate Trakt links.
The trakt url for episodes is `https://trakt.tv/episodes/{0}`.
| -rw-r--r-- | MediaBrowser.Controller/Entities/TV/Episode.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index dcc752f8c..7cdd07239 100644 --- a/MediaBrowser.Controller/Entities/TV/Episode.cs +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -11,6 +11,7 @@ using Jellyfin.Data.Enums; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; +using MediaBrowser.Model.Providers; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities.TV @@ -336,5 +337,22 @@ namespace MediaBrowser.Controller.Entities.TV return hasChanges; } + + public override List<ExternalUrl> GetRelatedUrls() + { + var list = base.GetRelatedUrls(); + + var imdbId = this.GetProviderId(MetadataProvider.Imdb); + if (!string.IsNullOrEmpty(imdbId)) + { + list.Add(new ExternalUrl + { + Name = "Trakt", + Url = string.Format(CultureInfo.InvariantCulture, "https://trakt.tv/episodes/{0}", imdbId) + }); + } + + return list; + } } } |
