/// <summary> /// Finds the certification. /// </summary> /// <param name="movieId">The movie identifier.</param> /// <returns></returns> public async Task <string> FindCertification(string movieId) { string url = string.Format("3/movie/{0}/releases?api_key={1}", movieId, MovieHelper.ThemoviedbApiKey); MovieCertificationResult result = await _restApiService.Get <MovieCertificationResult>(url); return(ConvertCertificationResult(result)); }
private string ConvertCertificationResult(MovieCertificationResult result) { CountryCertification certification = result.Countries.FirstOrDefault(cert => cert.Iso_3166_1 == "US"); if (certification == null) { certification = result.Countries.FirstOrDefault(); if (certification == null) { return(null); } } if (string.IsNullOrEmpty(certification.Certification)) { return(null); } return("Rated " + certification.Certification); }
private string ConvertCertificationResult(MovieCertificationResult result) { CountryCertification certification = result.Countries.FirstOrDefault(cert => cert.Iso_3166_1 == "US"); if(certification == null) { certification = result.Countries.FirstOrDefault(); if (certification == null) { return null; } } if (string.IsNullOrEmpty(certification.Certification)) { return null; } return "Rated " + certification.Certification; }