From ebf82ec09e9144fcc05c3eae3bdb25530ad9c55d Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 17 Apr 2013 17:33:17 -0700 Subject: [PATCH] Now Showing: series status from Trakt. --- NzbDrone.Core/MetadataSource/TraktProxy.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/NzbDrone.Core/MetadataSource/TraktProxy.cs b/NzbDrone.Core/MetadataSource/TraktProxy.cs index fc7e7aabb..e895050f0 100644 --- a/NzbDrone.Core/MetadataSource/TraktProxy.cs +++ b/NzbDrone.Core/MetadataSource/TraktProxy.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.IO; using System.Linq; using NzbDrone.Core.MediaCover; @@ -57,6 +58,7 @@ namespace NzbDrone.Core.MetadataSource series.Network = show.network; series.AirTime = show.air_time; series.TitleSlug = show.url.ToLower().Replace("http://trakt.tv/show/", ""); + series.Status = GetSeriesStatus(show.status); series.Images.Add(new MediaCover.MediaCover { CoverType = MediaCoverTypes.Banner, Url = show.images.banner }); series.Images.Add(new MediaCover.MediaCover { CoverType = MediaCoverTypes.Poster, Url = GetPosterThumbnailUrl(show.images.poster) }); @@ -86,5 +88,12 @@ namespace NzbDrone.Core.MetadataSource var withoutExtension = posterUrl.Substring(0, posterUrl.Length - extension.Length); return withoutExtension + "-138" + extension; } + + private static SeriesStatusType GetSeriesStatus(string status) + { + if (string.IsNullOrWhiteSpace(status)) return SeriesStatusType.Continuing; + if (status.Equals("Ended", StringComparison.InvariantCultureIgnoreCase)) return SeriesStatusType.Ended; + return SeriesStatusType.Continuing; + } } } \ No newline at end of file