Exemple #1
0
        private void PublishCastSkinProperties(TraktPersonShowCast creditItem)
        {
            GUICommon.SetProperty("#Trakt.Person.Show.CreditValue", creditItem.Character);
            GUICommon.SetProperty("#Trakt.Person.Show.CreditType", Translation.Character);

            GUICommon.SetShowProperties(creditItem.Show);
        }
Exemple #2
0
        private void PublishShowSkinProperties(TraktShowAnticipated anticipatedItem)
        {
            GUICommon.SetProperty("#Trakt.Show.ListCount", anticipatedItem.ListCount.ToString());
            GUICommon.SetProperty("#Trakt.Show.ListCount.Extra", string.Format(Translation.AppearsInList, anticipatedItem.ListCount));

            GUICommon.SetShowProperties(anticipatedItem.Show);
        }
        private void PublishShowSkinProperties(TraktShowTrending trendingItem)
        {
            GUICommon.SetProperty("#Trakt.Show.Watchers", trendingItem.Watchers.ToString());
            GUICommon.SetProperty("#Trakt.Show.Watchers.Extra", trendingItem.Watchers > 1 ? string.Format(Translation.PeopleWatching, trendingItem.Watchers) : Translation.PersonWatching);

            GUICommon.SetShowProperties(trendingItem.Show);
        }
Exemple #4
0
        private void PublishCrewSkinProperties(TraktPersonShowJob creditItem)
        {
            GUICommon.SetProperty("#Trakt.Person.Show.CreditValue", GUICommon.GetTranslatedCreditJob(creditItem.Job));
            GUICommon.SetProperty("#Trakt.Person.Show.CreditType", Translation.Job);

            GUICommon.SetShowProperties(creditItem.Show);
        }
Exemple #5
0
        private void InitProperties()
        {
            // only set property if file exists
            // if we set now and download later, image will not set to skin
            if (File.Exists(Fanart))
            {
                GUIUtils.SetProperty("#Trakt.Show.FanartImageFilename", Fanart);
            }
            else
            {
                DownloadFanart();
            }

            // set credit type property
            GUIUtils.SetProperty("#Trakt.Credit.Type", Type == CreditType.Cast ? Translation.Cast : Translation.Crew);

            // Set current Show properties
            if (Show != null)
            {
                GUICommon.SetShowProperties(Show);
            }

            // load last layout
            CurrentLayout = (Layout)TraktSettings.CreditsShowDefaultLayout;

            // update button label
            if (layoutButton != null)
            {
                GUIControl.SetControlLabel(GetID, layoutButton.GetID, GUICommon.GetLayoutTranslation(CurrentLayout));
            }
        }
        private void PublishWatchlistSkinProperties(TraktEpisodeWatchList item)
        {
            // publish watchlist properties
            GUICommon.SetProperty("#Trakt.Episode.WatchList.Inserted", item.ListedAt.FromISO8601().ToShortDateString());

            GUICommon.SetShowProperties(item.Show);
            GUICommon.SetEpisodeProperties(item.Show, item.Episode);
        }
 private void PublishShowSkinProperties(TraktUserListItem item)
 {
     if (item == null || item.Show == null)
     {
         return;
     }
     GUICommon.SetShowProperties(item.Show);
 }
Exemple #8
0
        private void OnShowSelected(GUIListItem item, GUIControl parent)
        {
            PreviousSelectedIndex = Facade.SelectedListItemIndex;

            var selectedShow = item.TVTag as TraktShowSummary;

            GUICommon.SetShowProperties(selectedShow);

            GUIImageHandler.LoadFanart(backdrop, TmdbCache.GetShowBackdropFilename((item as GUIShowListItem).Images.ShowImages));
        }
Exemple #9
0
        private void PublishEpisodeSkinProperties(KeyValuePair <TraktShow, TraktWatchListEpisode.Episode> e)
        {
            var show    = e.Key;
            var episode = e.Value;

            GUICommon.SetProperty("#Trakt.Episode.WatchList.Inserted", episode.Inserted.FromEpoch().ToShortDateString());

            GUICommon.SetShowProperties(show);
            GUICommon.SetEpisodeProperties(episode);
        }
Exemple #10
0
        private void OnShowSelected(GUIListItem item, GUIControl parent)
        {
            PreviousSelectedIndex = Facade.SelectedListItemIndex;

            var selectedShow = item.TVTag as TraktShow;

            GUICommon.SetShowProperties(selectedShow);

            GUIImageHandler.LoadFanart(backdrop, selectedShow.Images.Fanart.LocalImageFilename(ArtworkType.ShowFanart));
        }
Exemple #11
0
        private TraktShowSummary GetShowSummary(string id)
        {
            var showSummary = TraktAPI.TraktAPI.GetShowSummary(id);

            if (showSummary != null)
            {
                // Publish Show Properties
                GUICommon.SetShowProperties(showSummary);
            }
            return(showSummary);
        }
        private void OnEpisodeSelected(GUIListItem item, GUIControl parent)
        {
            PreviousSelectedIndex = Facade.SelectedListItemIndex;

            GUICommon.SetProperty("#Trakt.Episode.AddedDate", (item as GUIEpisodeListItem).Date);

            var episodeSummary = (TraktEpisodeSummary)item.TVTag;

            GUICommon.SetShowProperties(episodeSummary.Show);
            GUICommon.SetEpisodeProperties(episodeSummary.Episode);

            GUIImageHandler.LoadFanart(backdrop, episodeSummary.Show.Images.Fanart.LocalImageFilename(ArtworkType.ShowFanart));
        }
        private void OnEpisodeSelected(GUIListItem item, GUIControl parent)
        {
            var episodeSummary = item.TVTag as TraktEpisodeSummary;

            if (episodeSummary == null)
            {
                return;
            }

            PreviousSelectedIndex = Facade.SelectedListItemIndex;

            GUICommon.SetEpisodeProperties(episodeSummary.Episode);

            // set season properties as well, we may show a flattened view
            // with all episodes in a show
            GUICommon.SetSeasonProperties(Season);
            GUICommon.SetShowProperties(Show);
        }
Exemple #14
0
        private void OnEpisodeSelected(GUIListItem item, GUIControl parent)
        {
            PreviousSelectedIndex = Facade.SelectedListItemIndex;

            GUICommon.SetProperty("#Trakt.Episode.AddedDate", (item as GUIEpisodeListItem).Date);

            var episodeSummary = item.TVTag as TraktEpisodeSummaryEx;

            if (episodeSummary == null)
            {
                return;
            }

            GUICommon.SetShowProperties(episodeSummary.Show);
            GUICommon.SetEpisodeProperties(episodeSummary.Show, episodeSummary.Episode);

            GUIImageHandler.LoadFanart(backdrop, TmdbCache.GetShowBackdropFilename((item as GUIEpisodeListItem).Images.ShowImages));
        }
        private void OnEpisodeSelected(GUIListItem item, GUIControl parent)
        {
            var recent = item.TVTag as TraktEpisodeHistory;

            if (recent == null)
            {
                return;
            }

            PreviousSelectedIndex = Facade.SelectedListItemIndex;

            GUICommon.SetProperty("#Trakt.Episode.WatchedDate", (item as GUIEpisodeListItem).Date);
            GUICommon.SetProperty("#Trakt.Episode.Action", recent.Action);
            GUICommon.SetShowProperties(recent.Show);
            GUICommon.SetEpisodeProperties(recent.Show, recent.Episode);

            GUIImageHandler.LoadFanart(backdrop, TmdbCache.GetShowBackdropFilename((item as GUIEpisodeListItem).Images.ShowImages));
        }
Exemple #16
0
        private void PublishShoutSkinProperties(TraktActivity.Activity activity)
        {
            if (activity == null)
            {
                return;
            }

            if (activity.Shout == null && activity.Review == null)
            {
                return;
            }

            GUIUtils.SetProperty("#Trakt.Shout.Type", activity.Type);
            GUICommon.SetProperty("#Trakt.Shout.Date", activity.Timestamp.FromEpoch().ToShortDateString());

            // set shout/review properties
            GUIUtils.SetProperty("#Trakt.Shout.Text", activity.Shout != null ? GetActivityShoutText(activity) : GetActivityReviewText(activity));
            GUIUtils.SetProperty("#Trakt.Shout.Spoiler", activity.Shout != null ? activity.Shout.Spoiler.ToString() : activity.Review.Spoiler.ToString());
            GUIUtils.SetProperty("#Trakt.Shout.Review", (activity.Review != null).ToString());

            // set user properties
            GUICommon.SetUserProperties(activity.User);

            // set movie, show or episode properties
            // set show and episode properties for episode shouts
            if (activity.Movie != null)
            {
                GUICommon.SetMovieProperties(activity.Movie);
            }
            else
            {
                GUICommon.SetShowProperties(activity.Show);
                if (activity.Episode != null)
                {
                    GUICommon.SetEpisodeProperties(activity.Episode);
                }
            }
        }
        private void PublishCommentSkinProperties(TraktCommentItem item)
        {
            if (item == null || item.Comment == null)
            {
                return;
            }

            // set shout/review properties
            GUICommon.SetCommentProperties(item.Comment, item.IsWatched());

            // set user properties
            GUICommon.SetUserProperties(item.Comment.User);

            // set movie, show, season, episode or list properties
            // set show and episode properties for episode comments
            // set show and season for season comments
            if (item.Movie != null)
            {
                GUICommon.SetMovieProperties(item.Movie);
            }
            else if (item.Show != null)
            {
                GUICommon.SetShowProperties(item.Show);
                if (item.Season != null)
                {
                    GUICommon.SetSeasonProperties(item.Show, item.Season);
                }
                if (item.Episode != null)
                {
                    GUICommon.SetEpisodeProperties(item.Show, item.Episode);
                }
            }
            else if (item.List != null)
            {
                GUICommon.SetListProperties(item.List, CurrentUser);
            }
        }
Exemple #18
0
 private void PublishShowSkinProperties(TraktWatchListShow show)
 {
     GUICommon.SetProperty("#Trakt.Show.WatchList.Inserted", show.Inserted.FromEpoch().ToShortDateString());
     GUICommon.SetShowProperties(show);
 }
Exemple #19
0
 private void PublishSkinProperties(TraktEpisodeSummary episodeSummary)
 {
     GUICommon.SetShowProperties(episodeSummary.Show);
     GUICommon.SetEpisodeProperties(episodeSummary.Episode);
 }
 private void PublishWatchlistSkinProperties(TraktShowWatchList item)
 {
     GUICommon.SetProperty("#Trakt.Show.WatchList.Inserted", item.ListedAt.FromISO8601().ToShortDateString());
     GUICommon.SetShowProperties(item.Show);
 }
 private void PublishShowSkinProperties(TraktShowSummary PopularItem)
 {
     GUICommon.SetShowProperties(PopularItem);
 }
Exemple #22
0
 private void PublishCalendarSkinProperties(TraktShowCalendar calendarItem)
 {
     GUICommon.SetShowProperties(calendarItem.Show);
     GUICommon.SetEpisodeProperties(calendarItem.Show, calendarItem.Episode);
 }
        private void SendSeasonEpisodesToFacade(IEnumerable <TraktEpisode> episodes)
        {
            // clear facade
            GUIControl.ClearControl(GetID, Facade.GetID);

            if (episodes == null || episodes.Count() == 0)
            {
                GUIUtils.ShowNotifyDialog(GUIUtils.PluginName(), Translation.NoEpisodesInSeason);
                GUIWindowManager.ShowPreviousWindow();
                return;
            }

            // Set Common Show Properties
            GUICommon.SetShowProperties(Show);

            int itemCount     = 0;
            var episodeImages = new List <TraktImage>();

            foreach (var episode in episodes)
            {
                // use episode short string
                string itemLabel = string.Format("{0}. {1}", episode.Number.ToString(), string.IsNullOrEmpty(episode.Title) ? Translation.Episode + " " + episode.Number.ToString() : episode.Title);

                // add image for download
                var images = new TraktImage
                {
                    EpisodeImages = episode.Images,
                    ShowImages    = Show.Images
                };

                episodeImages.Add(images);

                var item = new GUIEpisodeListItem(itemLabel, (int)TraktGUIWindows.SeasonEpisodes);

                item.Label2 = episode.FirstAired == 0 ? " " : episode.FirstAired.FromEpoch().ToShortDateString();
                item.TVTag  = new TraktEpisodeSummary {
                    Episode = episode, Show = Show
                };
                item.IsPlayed        = episode.Watched;
                item.Images          = images;
                item.ItemId          = Int32.MaxValue - itemCount;
                item.IconImage       = "defaultTraktEpisode.png";
                item.IconImageBig    = "defaultTraktEpisodeBig.png";
                item.ThumbnailImage  = "defaultTraktEpisodeBig.png";
                item.OnItemSelected += OnEpisodeSelected;
                Utils.SetDefaultIcons(item);
                Facade.Add(item);
                itemCount++;
            }

            // Set Facade Layout
            Facade.SetCurrentLayout(Enum.GetName(typeof(Layout), CurrentLayout));
            GUIControl.FocusControl(GetID, Facade.GetID);

            if (PreviousSelectedIndex >= itemCount)
            {
                Facade.SelectIndex(PreviousSelectedIndex - 1);
            }
            else
            {
                Facade.SelectIndex(PreviousSelectedIndex);
            }

            // set facade properties
            GUIUtils.SetProperty("#itemcount", itemCount.ToString());
            GUIUtils.SetProperty("#Trakt.Items", string.Format("{0} {1}", itemCount.ToString(), itemCount > 1 ? Translation.Episodes : Translation.Episode));

            // Download episode images Async and set to facade
            GUIEpisodeListItem.GetImages(episodeImages);
        }
 private void PublishShowSkinProperties(TraktShowSummary show)
 {
     GUICommon.SetShowProperties(show);
 }