From 7fb9f33c8c11ee4c6b272b231ecd2dc62490b5f7 Mon Sep 17 00:00:00 2001 From: Mikal Stordal Date: Thu, 10 Oct 2024 23:02:11 +0200 Subject: [PATCH] fix: ensure en-US content ratings exist at all times if available --- Shoko.Server/Models/TMDB/TMDB_Movie.cs | 2 +- Shoko.Server/Models/TMDB/TMDB_Show.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Shoko.Server/Models/TMDB/TMDB_Movie.cs b/Shoko.Server/Models/TMDB/TMDB_Movie.cs index 04fe04a22..4d6483ecf 100644 --- a/Shoko.Server/Models/TMDB/TMDB_Movie.cs +++ b/Shoko.Server/Models/TMDB/TMDB_Movie.cs @@ -226,7 +226,7 @@ public bool Populate(Movie movie, HashSet? crLanguages) movie.ReleaseDates.Results .Where(releaseDate => releaseDate.ReleaseDates.Any(r => !string.IsNullOrEmpty(r.Certification))) .Select(releaseDate => new TMDB_ContentRating(releaseDate.Iso_3166_1, releaseDate.ReleaseDates.Last(r => !string.IsNullOrEmpty(r.Certification)).Certification)) - .WhereInLanguages(crLanguages) + .WhereInLanguages(crLanguages?.Append(TitleLanguage.EnglishAmerican).ToHashSet()) .OrderBy(c => c.CountryCode) .ToList(), v => ContentRatings = v, diff --git a/Shoko.Server/Models/TMDB/TMDB_Show.cs b/Shoko.Server/Models/TMDB/TMDB_Show.cs index 4c9fef335..4fbf1bd40 100644 --- a/Shoko.Server/Models/TMDB/TMDB_Show.cs +++ b/Shoko.Server/Models/TMDB/TMDB_Show.cs @@ -218,7 +218,7 @@ public bool Populate(TvShow show, HashSet? crLanguages) ContentRatings, show.ContentRatings.Results .Select(rating => new TMDB_ContentRating(rating.Iso_3166_1, rating.Rating)) - .WhereInLanguages(crLanguages) + .WhereInLanguages(crLanguages?.Append(TitleLanguage.EnglishAmerican).ToHashSet()) .OrderBy(c => c.CountryCode) .ToList(), v => ContentRatings = v,