aboutsummaryrefslogtreecommitdiff
path: root/common/src
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-02-02 00:25:45 +0100
committermetamuffin <metamuffin@disroot.org>2025-02-02 00:25:45 +0100
commit1534bb6d8f88d83c1ce9c89d007af04dcc3291f1 (patch)
tree4df67a6ad396a97094afd7dd9e57775320075655 /common/src
parent4993f189870a96a328bdda5838d1d184c1bbdb67 (diff)
downloadjellything-1534bb6d8f88d83c1ce9c89d007af04dcc3291f1.tar
jellything-1534bb6d8f88d83c1ce9c89d007af04dcc3291f1.tar.bz2
jellything-1534bb6d8f88d83c1ce9c89d007af04dcc3291f1.tar.zst
node visibility
Diffstat (limited to 'common/src')
-rw-r--r--common/src/lib.rs28
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,