Skip to content

Commit

Permalink
fix: ensure en-US content ratings exist at all times if available
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed Oct 10, 2024
1 parent 36043df commit 7fb9f33
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Shoko.Server/Models/TMDB/TMDB_Movie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public bool Populate(Movie movie, HashSet<TitleLanguage>? 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,
Expand Down
2 changes: 1 addition & 1 deletion Shoko.Server/Models/TMDB/TMDB_Show.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public bool Populate(TvShow show, HashSet<TitleLanguage>? 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,
Expand Down

0 comments on commit 7fb9f33

Please sign in to comment.