diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/src/lib.rs | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/common/src/lib.rs b/common/src/lib.rs index 9d22eec..46d543d 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -27,10 +27,11 @@ pub struct NodeID(pub [u8; 32]); #[derive(Debug, Clone, Deserialize, Serialize, Default, Encode, Decode)] pub struct Node { + #[serde(default)] pub slug: String, #[serde(default)] pub parents: BTreeSet<NodeID>, - pub kind: Option<NodeKind>, + pub kind: NodeKind, pub poster: Option<Asset>, pub backdrop: Option<Asset>, pub title: Option<String>, @@ -47,6 +48,8 @@ pub struct Node { pub people: BTreeMap<PeopleGroup, Vec<Appearance>>, #[serde(default)] pub external_ids: BTreeMap<String, String>, + #[serde(default)] + pub visibility: Visibility, } #[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, Encode, Decode)] @@ -96,10 +99,33 @@ pub enum PeopleGroup { CreatedBy, } +#[derive( + Debug, + Clone, + Copy, + Deserialize, + Serialize, + PartialEq, + Eq, + PartialOrd, + Ord, + Encode, + Decode, + Default, +)] +#[serde(rename_all = "snake_case")] +pub enum Visibility { + Hidden, + Reduced, + #[default] + Visible, +} + #[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq, Default, Encode, Decode)] #[serde(rename_all = "snake_case")] pub enum NodeKind { #[default] + Unknown, Movie, Video, Music, |