|
|
@ -19,9 +19,9 @@ namespace NzbDrone.Core.MetadataSource
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var client = BuildClient("search", "shows");
|
|
|
|
var client = BuildClient("search", "shows");
|
|
|
|
var restRequest = new RestRequest(GetSearchTerm(title));
|
|
|
|
var restRequest = new RestRequest(GetSearchTerm(title));
|
|
|
|
var response = client.ExecuteAndValidate<List<Show>>(restRequest);
|
|
|
|
var response = client.ExecuteAndValidate<List<SearchShow>>(restRequest);
|
|
|
|
|
|
|
|
|
|
|
|
return response.Select(MapSeries).ToList();
|
|
|
|
return response.Select(MapSearchSeries).ToList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -77,6 +77,28 @@ namespace NzbDrone.Core.MetadataSource
|
|
|
|
return series;
|
|
|
|
return series;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static Series MapSearchSeries(SearchShow show)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var series = new Series();
|
|
|
|
|
|
|
|
series.TvdbId = show.tvdb_id;
|
|
|
|
|
|
|
|
series.TvRageId = show.tvrage_id;
|
|
|
|
|
|
|
|
series.ImdbId = show.imdb_id;
|
|
|
|
|
|
|
|
series.Title = show.title;
|
|
|
|
|
|
|
|
series.CleanTitle = Parser.Parser.CleanSeriesTitle(show.title);
|
|
|
|
|
|
|
|
series.FirstAired = FromIso(show.first_aired_iso);
|
|
|
|
|
|
|
|
series.Overview = show.overview;
|
|
|
|
|
|
|
|
series.Runtime = show.runtime;
|
|
|
|
|
|
|
|
series.Network = show.network;
|
|
|
|
|
|
|
|
series.AirTime = show.air_time_utc;
|
|
|
|
|
|
|
|
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) });
|
|
|
|
|
|
|
|
series.Images.Add(new MediaCover.MediaCover { CoverType = MediaCoverTypes.Fanart, Url = show.images.fanart });
|
|
|
|
|
|
|
|
return series;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static Episode MapEpisode(Trakt.Episode traktEpisode)
|
|
|
|
private static Episode MapEpisode(Trakt.Episode traktEpisode)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var episode = new Episode();
|
|
|
|
var episode = new Episode();
|
|
|
|