Пример #1
0
        internal static void SetEpisodeProperties(TraktShowSummary show, TraktEpisodeSummary episode)
        {
            if (episode == null) return;

            SetProperty("#Trakt.Episode.Id", episode.Ids.Trakt);
            SetProperty("#Trakt.Episode.TvdbId", episode.Ids.Tvdb);
            SetProperty("#Trakt.Episode.ImdbId", episode.Ids.Imdb);
            SetProperty("#Trakt.Episode.TmdbId", episode.Ids.Imdb);
            SetProperty("#Trakt.Episode.Number", episode.Number);
            SetProperty("#Trakt.Episode.Season", episode.Season);
            if (episode.FirstAired != null)
            {
                // FirstAired is converted to UTC from original countries timezone on trakt
                SetProperty("#Trakt.Episode.FirstAired", episode.FirstAired.FromISO8601().ToShortDateString());
                SetProperty("#Trakt.Episode.FirstAiredLocalized", episode.FirstAired.FromISO8601().ToLocalTime().ToShortDateString());
                SetProperty("#Trakt.Episode.FirstAiredLocalizedDayOfWeek", episode.FirstAired.FromISO8601().ToLocalTime().ToLocalisedDayOfWeek());
                SetProperty("#Trakt.Episode.FirstAiredLocalizedTime", episode.FirstAired.FromISO8601().ToLocalTime().ToShortTimeString());
            }
            SetProperty("#Trakt.Episode.Title", string.IsNullOrEmpty(episode.Title) ? string.Format("{0} {1}", Translation.Episode, episode.Number.ToString()) : episode.Title.RemapHighOrderChars());
            SetProperty("#Trakt.Episode.Url", string.Format("http://trakt.tv/shows/{0}/seasons/{1}/episodes/{2}", show.Ids.Slug, episode.Season, episode.Number));
            SetProperty("#Trakt.Episode.Overview", episode.Overview.ToNullIfEmpty() == null ? Translation.NoEpisodeSummary : episode.Overview.RemapHighOrderChars());
            SetProperty("#Trakt.Episode.Runtime", show.Runtime);
            SetProperty("#Trakt.Episode.InWatchList", episode.IsWatchlisted());
            SetProperty("#Trakt.Episode.InCollection", episode.IsCollected(show));
            SetProperty("#Trakt.Episode.Plays", episode.Plays(show));
            SetProperty("#Trakt.Episode.Watched", episode.IsWatched(show));
            SetProperty("#Trakt.Episode.Rating", episode.UserRating(show));
            SetProperty("#Trakt.Episode.Ratings.Percentage", episode.Rating.ToPercentage());
            SetProperty("#Trakt.Episode.Ratings.Votes", episode.Votes);
            SetProperty("#Trakt.Episode.Ratings.Icon", (episode.Rating >= 6) ? "love" : "hate");
            //if (episode.Images != null)
            //{
            //    SetProperty("#Trakt.Episode.EpisodeImageFilename", episode.Images.ScreenShot.LocalImageFilename(ArtworkType.EpisodeImage));
            //}
        }
Пример #2
0
 public static void ShowEpisodeShouts(TraktShowSummary show, TraktEpisodeSummary episode)
 {
     var showImages = TmdbCache.GetShowImages(show.Ids.Tmdb, true);
     ShowEpisodeShouts(show.Title, show.Year, show.Ids.Tvdb, show.Ids.Trakt, show.Ids.Imdb, episode.Season, episode.Number, episode.IsWatched(show), TmdbCache.GetShowBackdropFilename(showImages), TmdbCache.GetShowBackdropUrl(showImages));
 }