Refactor ShowAudience handling across the application to align with MPAA rating system. Update ShowAudience enum to reflect new ratings (G, PG, PG-13, R, NC-17) and adjust related data models, API types, and frontend components to support nullable audience values. Enhance metadata handling to incorporate content ratings from external sources, ensuring proper audience filtering in scheduling logic. Update documentation to clarify changes in audience categorization and its implications for content management.
This commit is contained in:
+5
-2
@@ -100,9 +100,12 @@ public sealed class FindGroupCandidatesQueryHandler(
|
||||
if (filter.ShowKinds is { Count: > 0 } kinds)
|
||||
shows = shows.Where(s => kinds.Contains(s.Kind));
|
||||
|
||||
// Категории упорядочены по возрастанию строгости, поэтому «не строже» — обычное сравнение.
|
||||
// Рейтинги упорядочены по возрастанию строгости, поэтому «не строже» — обычное сравнение.
|
||||
// Шоу без рейтинга остаются в выборке — ровно как в планировщике (ElementSelector): источники
|
||||
// проставляют рейтинг далеко не всему, и молчаливое выбрасывание непроставленного оставило бы
|
||||
// от фильтра «мультики не строже PG» горстку голливудского.
|
||||
if (filter.MaxAudience is { } maxAudience)
|
||||
shows = shows.Where(s => s.Audience <= maxAudience);
|
||||
shows = shows.Where(s => s.Audience == null || s.Audience <= maxAudience);
|
||||
|
||||
if (filter.YearMin is { } yearMin)
|
||||
shows = shows.Where(s => s.Year != null && s.Year >= yearMin);
|
||||
|
||||
@@ -125,7 +125,7 @@ public sealed class GroupElementResolver(IAppDbContext dbContext)
|
||||
partAssets.Count,
|
||||
DurationOf(partAssets),
|
||||
null,
|
||||
// Категория коллекции — самая строгая среди частей: по ней отбирают в детское время.
|
||||
// Рейтинг коллекции — самый строгий среди частей: по нему отбирают в детское время.
|
||||
parts.Count == 0 ? null : parts.Max(p => p!.Audience),
|
||||
parts.Count == 0 ? null : parts.Min(p => p!.Year),
|
||||
collection.PosterImageId
|
||||
|
||||
Reference in New Issue
Block a user