media_tools/models/
content_restrictions.rs1use serde::{Deserialize, Serialize};
3
4use super::MediaProfileId;
5
6#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
8#[serde(default)]
9pub struct ContentRestrictions {
10 pub profile_id: MediaProfileId,
11 pub maximum_certification: Option<String>,
13 pub disallowed_genres: Vec<String>,
15 pub disallowed_themes: Vec<String>,
17 pub allow_unrated: bool,
19}
20
21impl ContentRestrictions {
22 pub fn new(profile_id: MediaProfileId) -> Self {
23 Self {
24 profile_id,
25 maximum_certification: None,
26 disallowed_genres: Vec::new(),
27 disallowed_themes: Vec::new(),
28 allow_unrated: false,
29 }
30 }
31}
32
33impl Default for ContentRestrictions {
34 fn default() -> Self {
35 Self::new(MediaProfileId::new())
36 }
37}