diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2024-12-07 19:26:58 +0100 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2025-02-20 10:13:27 +0100 |
| commit | 5303445c9b4c9934145151f20c084033ffd1e7c6 (patch) | |
| tree | 17d8d313947dbe97efd9398cb31e0a188b124388 /MediaBrowser.Providers/TV | |
| parent | 712908d53c7ca38d13e03ea7809e0c40e862a5fb (diff) | |
Migrate to IExternalUrlProvider
Diffstat (limited to 'MediaBrowser.Providers/TV')
| -rw-r--r-- | MediaBrowser.Providers/TV/Zap2ItExternalId.cs | 3 | ||||
| -rw-r--r-- | MediaBrowser.Providers/TV/Zap2ItExternalUrlProvider.cs | 25 |
2 files changed, 25 insertions, 3 deletions
diff --git a/MediaBrowser.Providers/TV/Zap2ItExternalId.cs b/MediaBrowser.Providers/TV/Zap2ItExternalId.cs index 3cb18e424..8907d7744 100644 --- a/MediaBrowser.Providers/TV/Zap2ItExternalId.cs +++ b/MediaBrowser.Providers/TV/Zap2ItExternalId.cs @@ -19,9 +19,6 @@ namespace MediaBrowser.Providers.TV public ExternalIdMediaType? Type => null; /// <inheritdoc /> - public string UrlFormatString => "http://tvlistings.zap2it.com/overview.html?programSeriesId={0}"; - - /// <inheritdoc /> public bool Supports(IHasProviderIds item) => item is Series; } } diff --git a/MediaBrowser.Providers/TV/Zap2ItExternalUrlProvider.cs b/MediaBrowser.Providers/TV/Zap2ItExternalUrlProvider.cs new file mode 100644 index 000000000..f6516fdde --- /dev/null +++ b/MediaBrowser.Providers/TV/Zap2ItExternalUrlProvider.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Entities; + +namespace MediaBrowser.Providers.TV; + +/// <summary> +/// External URLs for TMDb. +/// </summary> +public class Zap2ItExternalUrlProvider : IExternalUrlProvider +{ + /// <inheritdoc/> + public string Name => "Zap2It"; + + /// <inheritdoc/> + public IEnumerable<string> GetExternalUrls(BaseItem item) + { + var externalId = item.GetProviderId(MetadataProvider.Zap2It); + if (!string.IsNullOrEmpty(externalId)) + { + yield return $"http://tvlistings.zap2it.com/overview.html?programSeriesId={externalId}"; + } + } +} |
