Esempio n. 1
0
        private static DbPersonInfo GetPersonInformation(Tmdb api, TmdbPerson personNode, string language)
        {
            LogMyFilms.Debug("GetPersonInformation()");

              if (personNode == null) return null;

              List<string> images = new List<string>();
              DbPersonInfo person = new DbPersonInfo();

              try
              {
            TmdbPerson m = api.GetPersonInfo(personNode.id);

            person.Id = m.id.ToString();
            person.Name = m.name;
            person.Biography = m.biography;
            person.Birthday = m.birthday;
            person.Birthplace = m.place_of_birth;
            person.DetailsUrl = m.homepage;

            TmdbPersonCredits p = api.GetPersonCredits(personNode.id);

            foreach (CastCredit cast in p.cast)
            {
            }

            foreach (CrewCredit crew in p.crew)
            {
            }

            TmdbConfiguration tmdbConf = api.GetConfiguration();

            TmdbPersonImages personImages = api.GetPersonImages(personNode.id);
            foreach (PersonImageProfile imageProfile in personImages.profiles)
            {
              person.Images.Add(tmdbConf.images.base_url + "w500" + imageProfile.file_path);
            }
              }
              catch (Exception ex)
              {
            LogMyFilms.Debug(ex.StackTrace);
              }
              return person;
        }
Esempio n. 2
0
    private static void SetActorDetailsFromTmdb(TmdbPerson tmdbPerson, TmdbConfiguration conf, ref IMDBActor imdbPerson)
    {
      if (tmdbPerson == null)
      {
        LogMyFilms.Debug("SetActorDetailsFromTMDB() - TMDB person is 'null' - return");
        return;
      }
      if (imdbPerson == null)
      {
        LogMyFilms.Debug("SetActorDetailsFromTMDB() - IMDB person is 'null' - return");
        return;
      }
      string tmdbProfileSize = "original";
      foreach (string profileSize in conf.images.profile_sizes.Where(profileSize => profileSize == "h632"))
      {
        tmdbProfileSize = profileSize;
      }

      // imdbPerson.IMDBActorID = 
      // imdbPerson.Name = tmdbPerson.name;
      // imdbPerson.MiniBiography = tmdbPerson.biography;
      // LogMyFilms.Debug("SetActorDetailsFromTMDB() - update IMDB name     - old : '" + imdbPerson.Name + "', new: '" + tmdbPerson.name + "'");
      if (!string.IsNullOrEmpty(tmdbPerson.biography) && tmdbPerson.biography.Length > imdbPerson.Biography.Length)
      {
        // LogMyFilms.Debug("SetActorDetailsFromTMDB() - update IMDB bio      - old : '" + imdbPerson.Biography + "', new: '" + tmdbPerson.biography + "'");
        imdbPerson.Biography = tmdbPerson.biography;
      }

      if (!string.IsNullOrEmpty(tmdbPerson.birthday))
      {
        LogMyFilms.Debug("SetActorDetailsFromTMDB() - update IMDB birthday - old : '" + imdbPerson.DateOfBirth + "', new: '" + tmdbPerson.birthday + "'");
        imdbPerson.DateOfBirth = tmdbPerson.birthday + ((!string.IsNullOrEmpty(tmdbPerson.deathday)) ? " (" + tmdbPerson.deathday + ")" : "");
      }
      if (!string.IsNullOrEmpty(tmdbPerson.place_of_birth))
      {
        LogMyFilms.Debug("SetActorDetailsFromTMDB() - update IMDB b-place  - old : '" + imdbPerson.PlaceOfBirth + "', new: '" + tmdbPerson.place_of_birth + "'");
        imdbPerson.PlaceOfBirth = tmdbPerson.place_of_birth;
      }
      if (!string.IsNullOrEmpty(tmdbPerson.profile_path))
      {
        LogMyFilms.Debug("SetActorDetailsFromTMDB() - update IMDB thumb    - old : '" + imdbPerson.ThumbnailUrl + "', new: '" + conf.images.base_url + tmdbProfileSize + tmdbPerson.profile_path + "'");
        imdbPerson.ThumbnailUrl = conf.images.base_url + tmdbProfileSize + tmdbPerson.profile_path;
      }
    }