aboutsummaryrefslogtreecommitdiff
path: root/common/src
diff options
context:
space:
mode:
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)]