예제 #1
0
        private static Series MapSeries(Show 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.Year = GetYear(show.year, show.first_aired);
            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, show.ended);
            series.Ratings = GetRatings(show.ratings);
            series.Genres = show.genres;
            series.Certification = show.certification;
            series.Actors = GetActors(show.people);
            series.Seasons = GetSeasons(show);

            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;
        }
예제 #2
0
        private static Series MapSeries(Show 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.Year = GetYear(show.year, show.first_aired);
            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.Seasons = show.seasons.Select(s => new Tv.Season
            {
                SeasonNumber = s.season
            }).OrderByDescending(s => s.SeasonNumber).ToList();
            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;
        }
예제 #3
0
        private static List<Tv.Season> GetSeasons(Show show)
        {
            var seasons = new List<Tv.Season>();

            foreach (var traktSeason in show.seasons.OrderByDescending(s => s.season))
            {
                var season = new Tv.Season
                {
                    SeasonNumber = traktSeason.season
                };

                if (traktSeason.images != null)
                {
                    season.Images.Add(new MediaCover.MediaCover(MediaCoverTypes.Poster, traktSeason.images.poster));
                }
                
                seasons.Add(season);
            }

            return seasons;
        }