internal static void SetPersonProperties(TraktPersonSummary person)
 {
     SetProperty("#Trakt.Person.Id", person.Ids.Trakt);
     SetProperty("#Trakt.Person.ImdbId", person.Ids.ImdbId);
     SetProperty("#Trakt.Person.TmdbId", person.Ids.TmdbId);
     SetProperty("#Trakt.Person.TvRageId", person.Ids.TvRageId);
     SetProperty("#Trakt.Person.Name", person.Name);
     //if (person.Images != null)
     //{
     //    SetProperty("#Trakt.Person.HeadshotUrl", person.Images.HeadShot.FullSize);
     //    SetProperty("#Trakt.Person.HeadshotFilename", person.Images.HeadShot.LocalImageFilename(ArtworkType.PersonHeadshot));
     //    if (person.Images.Fanart != null && System.IO.File.Exists(person.Images.Fanart.LocalImageFilename(ArtworkType.PersonFanart)))
     //    {
     //        SetProperty("#Trakt.Person.FanartUrl", person.Images.Fanart.FullSize);
     //        SetProperty("#Trakt.Person.FanartFilename", person.Images.Fanart.LocalImageFilename(ArtworkType.PersonFanart));
     //    }
     //}
     SetProperty("#Trakt.Person.Url", string.Format("http://trakt.tv/people/{0}", person.Ids.Slug));
     SetProperty("#Trakt.Person.Biography", person.Biography ?? Translation.NoPersonBiography.RemapHighOrderChars());
     SetProperty("#Trakt.Person.Birthday", person.Birthday);
     SetProperty("#Trakt.Person.Birthplace", person.Birthplace);
     SetProperty("#Trakt.Person.Death", person.Death);
 }
        private void SendPersonSummaryToFacade(TraktPersonSummary person)
        {
            // clear facade
            GUIControl.ClearControl(GetID, Facade.GetID);

            if (person == null)
            {
                GUIUtils.ShowNotifyDialog(Translation.Error, Translation.ErrorGeneral);
                GUIWindowManager.ShowPreviousWindow();
                return;
            }

            // publish person properties
            PublishSkinProperties(person);

            var personImages = new List<GUITmdbImage>();
            int itemId = 0;

            // add image for download
            var images = new GUITmdbImage { PeopleImages = new TmdbPeopleImages { Id = person.Ids.TmdbId } };
            personImages.Add(images);

            // Add movie and show credit items
            var item = new GUIPersonListItem(Translation.MovieCredits, (int)TraktGUIWindows.PersonSummary);

            item.TVTag = View.MovieCredits.ToString();
            item.ItemId = Int32.MaxValue - itemId;
            item.Images = images;
            item.IconImage = GUIImageHandler.GetDefaultPoster(false);
            item.IconImageBig = GUIImageHandler.GetDefaultPoster();
            item.ThumbnailImage = GUIImageHandler.GetDefaultPoster();
            item.OnItemSelected += OnItemSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);
            itemId++;

            // add image for download
            images = new GUITmdbImage { PeopleImages = new TmdbPeopleImages { Id = person.Ids.TmdbId } };
            personImages.Add(images);

            item = new GUIPersonListItem(Translation.ShowCredits, (int)TraktGUIWindows.PersonSummary);

            item.TVTag = View.ShowCredits.ToString();
            item.ItemId = Int32.MaxValue - itemId;
            item.Images = images;
            item.IconImage = GUIImageHandler.GetDefaultPoster(false);
            item.IconImageBig = GUIImageHandler.GetDefaultPoster();
            item.ThumbnailImage = GUIImageHandler.GetDefaultPoster();
            item.OnItemSelected += OnItemSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);
            itemId++;

            // Set Facade Layout
            Facade.SetCurrentLayout("List");
            GUIControl.FocusControl(GetID, Facade.GetID);

            // set facade properties
            GUIUtils.SetProperty("#itemcount", Facade.Count.ToString());

            // Download images Async
            DownloadFanart(person);

            GUIPersonListItem.GetImages(personImages, false);
        }
 private void PublishSkinProperties(TraktPersonSummary person)
 {
     GUICommon.SetPersonProperties(person);
 }
        private void DownloadFanart(TraktPersonSummary person)
        {
            var tFanart = new Thread(obj =>
            {
                //var tPerson = obj as TraktPersonSummary;
                //var personImages = TmdbCache.GetPersonImages(tPerson.Ids.TmdbId);
                //if (personImages == null)
                //    return;

                //string remoteThumb = TmdbCache.GetPersonHeadshotUrl(personImages);
                //string localThumb = TmdbCache.GetPersonHeadshotFilename(personImages);

                //if (localThumb == null || remoteThumb == null)
                //    return;

                //GUIImageHandler.DownloadImage(remoteThumb, localThumb);
                //if (!StopDownload)
                //{
                //    Thread.Sleep(500);
                //    GUIUtils.SetProperty("#Trakt.Person.FanartFilename", localThumb);
                //}
            })
            {
                Name = "Fanart"
            };

            tFanart.Start(person);
        }