mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
Now Showing: series status from Trakt.
This commit is contained in:
parent
e67202a918
commit
ebf82ec09e
@ -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 @@ private static Series MapSeries(Show show)
|
||||
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 @@ private static string GetPosterThumbnailUrl(string posterUrl)
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user