Пример #1
0
 private TmdbConfiguration GetConfiguration()
 {
     if (_configuration == null)
     {
         Logger.Debug("Getting TMDb configuration");
         _configuration = _tmdbApi.GetConfiguration();
     }
     return _configuration;
 }
Пример #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;
      }
    }