Fix other country ratings

This commit is contained in:
Eric Reed 2013-06-04 13:24:25 -04:00
parent 02fedead11
commit 4e5186ef0b

View File

@ -774,8 +774,8 @@ namespace MediaBrowser.Controller.Providers.Movies
{ {
var ourRelease = movieData.releases.countries.FirstOrDefault(c => c.iso_3166_1.Equals(ConfigurationManager.Configuration.MetadataCountryCode, StringComparison.OrdinalIgnoreCase)) ?? new Country(); var ourRelease = movieData.releases.countries.FirstOrDefault(c => c.iso_3166_1.Equals(ConfigurationManager.Configuration.MetadataCountryCode, StringComparison.OrdinalIgnoreCase)) ?? new Country();
var usRelease = movieData.releases.countries.FirstOrDefault(c => c.iso_3166_1.Equals("US", StringComparison.OrdinalIgnoreCase)) ?? new Country(); var usRelease = movieData.releases.countries.FirstOrDefault(c => c.iso_3166_1.Equals("US", StringComparison.OrdinalIgnoreCase)) ?? new Country();
var ratingPrefix = ConfigurationManager.Configuration.MetadataCountryCode.Equals("us", StringComparison.OrdinalIgnoreCase) ? "" : ConfigurationManager.Configuration.MetadataCountryCode +"-";
movie.OfficialRating = ourRelease.certification ?? usRelease.certification; movie.OfficialRating = ratingPrefix + ourRelease.certification ?? usRelease.certification;
if (ourRelease.release_date > new DateTime(1900, 1, 1)) if (ourRelease.release_date > new DateTime(1900, 1, 1))
{ {