aboutsummaryrefslogtreecommitdiff
path: root/common/src
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-07-31 19:53:01 +0200
committermetamuffin <metamuffin@disroot.org>2023-07-31 19:53:01 +0200
commitaeafba7847e189313df3025e6d6f291999b57350 (patch)
treebf7affdca28208695648bc9b18856cbb7049d1e8 /common/src
parent0c651f11920350a4aa96aa24f8fe15b28390aed2 (diff)
downloadjellything-aeafba7847e189313df3025e6d6f291999b57350.tar
jellything-aeafba7847e189313df3025e6d6f291999b57350.tar.bz2
jellything-aeafba7847e189313df3025e6d6f291999b57350.tar.zst
update server to new schema
Diffstat (limited to 'common/src')
-rw-r--r--common/src/lib.rs26
1 files changed, 16 insertions, 10 deletions
diff --git a/common/src/lib.rs b/common/src/lib.rs
index bab1d79..7392c87 100644
--- a/common/src/lib.rs
+++ b/common/src/lib.rs
@@ -1,3 +1,8 @@
+/*
+ This file is part of jellything (https://codeberg.org/metamuffin/jellything)
+ which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
+ Copyright (C) 2023 metamuffin <metamuffin.org>
+*/
pub mod r#impl;
use bincode::{Decode, Encode};
@@ -5,14 +10,14 @@ use serde::{Deserialize, Serialize};
use std::path::PathBuf;
#[derive(Debug, Clone, Deserialize, Serialize)]
-pub struct Item {
- pub public: ItemPublic,
- pub private: ItemPrivate,
+pub struct Node {
+ pub public: NodePublic,
+ pub private: NodePrivate,
}
#[rustfmt::skip]
#[derive(Debug, Clone, Deserialize, Serialize)]
-pub struct ItemPrivate {
+pub struct NodePrivate {
#[serde(default)] pub poster: Option<PathBuf>,
#[serde(default)] pub backdrop: Option<PathBuf>,
#[serde(default)] pub source: Option<MediaSource>,
@@ -20,24 +25,25 @@ pub struct ItemPrivate {
#[rustfmt::skip]
#[derive(Debug, Clone, Deserialize, Serialize)]
-pub struct ItemPublic {
- pub kind: ItemKind,
+pub struct NodePublic {
+ pub kind: NodeKind,
pub title: String,
+ #[serde(default)] pub children: Vec<String>,
#[serde(default)] pub tagline: Option<String>,
#[serde(default)] pub description: Option<String>,
- #[serde(default)] pub poster: Option<PathBuf>,
- #[serde(default)] pub backdrop: Option<PathBuf>,
#[serde(default)] pub index: Option<usize>,
#[serde(default)] pub media: Option<MediaInfo>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")]
-pub enum ItemKind {
+pub enum NodeKind {
+ Movie,
Collection,
- Series,
Show,
+ Series,
Season,
+ Episode,
}
#[derive(Debug, Clone, Deserialize, Serialize)]