From 4e5186ef0be7e52041823faf02fc0d157cccfa7d Mon Sep 17 00:00:00 2001 From: Eric Reed Date: Tue, 4 Jun 2013 13:24:25 -0400 Subject: [PATCH 1/2] Fix other country ratings --- MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs b/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs index e3e144844..32bb74aa0 100644 --- a/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs +++ b/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs @@ -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 usRelease = movieData.releases.countries.FirstOrDefault(c => c.iso_3166_1.Equals("US", StringComparison.OrdinalIgnoreCase)) ?? new Country(); - - movie.OfficialRating = ourRelease.certification ?? usRelease.certification; + var ratingPrefix = ConfigurationManager.Configuration.MetadataCountryCode.Equals("us", StringComparison.OrdinalIgnoreCase) ? "" : ConfigurationManager.Configuration.MetadataCountryCode +"-"; + movie.OfficialRating = ratingPrefix + ourRelease.certification ?? usRelease.certification; if (ourRelease.release_date > new DateTime(1900, 1, 1)) { From dbccd8d1b645193b7c9345bb60b682728163c8cd Mon Sep 17 00:00:00 2001 From: Eric Reed Date: Tue, 4 Jun 2013 13:34:06 -0400 Subject: [PATCH 2/2] Null coalescing was not going to work anymore... --- MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs b/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs index 32bb74aa0..091ce7c63 100644 --- a/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs +++ b/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs @@ -775,7 +775,7 @@ 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 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 = ratingPrefix + ourRelease.certification ?? usRelease.certification; + movie.OfficialRating = ourRelease.certification != null ? ratingPrefix + ourRelease.certification : usRelease.certification; if (ourRelease.release_date > new DateTime(1900, 1, 1)) {