diff options
Diffstat (limited to 'MediaBrowser.Providers/TV/TheTVDB/TvdbSeasonIdentityProvider.cs')
| -rw-r--r-- | MediaBrowser.Providers/TV/TheTVDB/TvdbSeasonIdentityProvider.cs | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/MediaBrowser.Providers/TV/TheTVDB/TvdbSeasonIdentityProvider.cs b/MediaBrowser.Providers/TV/TheTVDB/TvdbSeasonIdentityProvider.cs deleted file mode 100644 index 4198430c9f..0000000000 --- a/MediaBrowser.Providers/TV/TheTVDB/TvdbSeasonIdentityProvider.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.Threading.Tasks; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Entities; - -namespace MediaBrowser.Providers.TV -{ - public class TvdbSeasonIdentityProvider : IItemIdentityProvider<SeasonInfo> - { - public static readonly string FullIdKey = MetadataProviders.Tvdb + "-Full"; - - public Task Identify(SeasonInfo info) - { - string tvdbSeriesId; - if (!info.SeriesProviderIds.TryGetValue(MetadataProviders.Tvdb.ToString(), out tvdbSeriesId) || string.IsNullOrEmpty(tvdbSeriesId) || info.IndexNumber == null) - { - return Task.FromResult<object>(null); - } - - if (string.IsNullOrEmpty(info.GetProviderId(FullIdKey))) - { - var id = string.Format("{0}:{1}", tvdbSeriesId, info.IndexNumber.Value); - info.SetProviderId(FullIdKey, id); - } - - return Task.FromResult<object>(null); - } - - public static TvdbSeasonIdentity? ParseIdentity(string id) - { - if (id == null) - { - return null; - } - - try - { - var parts = id.Split(':'); - return new TvdbSeasonIdentity(parts[0], int.Parse(parts[1])); - } - catch - { - return null; - } - } - } - - public struct TvdbSeasonIdentity - { - public string SeriesId { get; private set; } - public int Index { get; private set; } - - public TvdbSeasonIdentity(string id) - : this() - { - this = TvdbSeasonIdentityProvider.ParseIdentity(id).Value; - } - - public TvdbSeasonIdentity(string seriesId, int index) - : this() - { - SeriesId = seriesId; - Index = index; - } - } -}
\ No newline at end of file |
