mirror of
https://github.com/Radarr/Radarr
synced 2026-01-07 08:08:17 +01:00
Fixed: More robust Certification Logic
This commit is contained in:
parent
8c25ccf1ea
commit
727347331f
1 changed files with 10 additions and 6 deletions
|
|
@ -206,15 +206,19 @@ public Tuple<Movie, List<Credit>> GetMovieInfo(int tmdbId, Profile profile, bool
|
|||
movie.PhysicalReleaseNote = releaseDate.note;
|
||||
}
|
||||
}
|
||||
|
||||
// Set Certification from Theatrical Release
|
||||
if (releaseDate.type == 3 && releaseDates.iso_3166_1 == _configService.CertificationCountry.ToString())
|
||||
{
|
||||
movie.Certification = releaseDate.certification;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var countryReleases = resource.release_dates.results.FirstOrDefault(m => m.iso_3166_1 == _configService.CertificationCountry.ToString());
|
||||
|
||||
// Set Certification from Theatrical Release(Type 3), if not fall back to Limited Threatrical(Type 2) and then Premiere(Type 1)
|
||||
if (countryReleases != null && countryReleases.release_dates.Any())
|
||||
{
|
||||
var certRelease = countryReleases.release_dates.OrderByDescending(c => c.type).Where(d => d.type <= 3).FirstOrDefault(c => c.certification.IsNotNullOrWhiteSpace());
|
||||
|
||||
movie.Certification = certRelease?.certification;
|
||||
}
|
||||
|
||||
movie.Ratings = new Ratings();
|
||||
movie.Ratings.Votes = resource.vote_count;
|
||||
movie.Ratings.Value = (decimal)resource.vote_average;
|
||||
|
|
|
|||
Loading…
Reference in a new issue