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:
@@ -21,8 +21,9 @@ public class Show
|
||||
public string? Description { get; private set; }
|
||||
public ShowKind Kind { get; private set; }
|
||||
|
||||
/// <summary>Категория аудитории (обычное/детское/взрослое) — под будущие фильтры показа.</summary>
|
||||
public ShowAudience Audience { get; private set; }
|
||||
/// <summary>Возрастной рейтинг (MPAA) или null, если не проставлен ни источником, ни вручную.
|
||||
/// Шоу без рейтинга планировщик не отсекает: неизвестное не значит «взрослое».</summary>
|
||||
public ShowAudience? Audience { get; private set; }
|
||||
|
||||
public DateTimeOffset CreatedAt { get; private set; }
|
||||
|
||||
@@ -52,7 +53,7 @@ public class Show
|
||||
ShowKind kind,
|
||||
string? description = null,
|
||||
string? originalName = null,
|
||||
ShowAudience audience = ShowAudience.General
|
||||
ShowAudience? audience = null
|
||||
) =>
|
||||
new()
|
||||
{
|
||||
@@ -65,8 +66,8 @@ public class Show
|
||||
CreatedAt = DateTimeOffset.UtcNow,
|
||||
};
|
||||
|
||||
/// <summary>Задать категорию аудитории.</summary>
|
||||
public void SetAudience(ShowAudience audience) => Audience = audience;
|
||||
/// <summary>Задать возрастной рейтинг; null — снять (вернуть в «не проставлен»).</summary>
|
||||
public void SetAudience(ShowAudience? audience) => Audience = audience;
|
||||
|
||||
/// <summary>Основной жанр или null, если жанры не проставлены.</summary>
|
||||
public Guid? PrimaryGenreId => _genres.FirstOrDefault(g => g.IsPrimary)?.GenreId;
|
||||
|
||||
Reference in New Issue
Block a user