aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-10-23 18:51:17 +0200
committermetamuffin <metamuffin@disroot.org>2023-10-23 18:51:17 +0200
commit57fccd01d487284bb317fb1ff778e0fd2e140c12 (patch)
tree1226bd53a037192336217e7ae64c9b3042f07589 /common
parentc4de8d95619d6d8da8640801aeecc912cdb8d0b5 (diff)
downloadjellything-57fccd01d487284bb317fb1ff778e0fd2e140c12.tar
jellything-57fccd01d487284bb317fb1ff778e0fd2e140c12.tar.bz2
jellything-57fccd01d487284bb317fb1ff778e0fd2e140c12.tar.zst
release date from infojson and sorting
Diffstat (limited to 'common')
-rw-r--r--common/Cargo.toml1
-rw-r--r--common/src/lib.rs4
2 files changed, 5 insertions, 0 deletions
diff --git a/common/Cargo.toml b/common/Cargo.toml
index b38b962..437fb0b 100644
--- a/common/Cargo.toml
+++ b/common/Cargo.toml
@@ -7,6 +7,7 @@ edition = "2021"
serde = { version = "1.0.188", features = ["derive"] }
bincode = { version = "2.0.0-rc.3", features = ["derive"] }
rocket = { workspace = true, optional = true }
+chrono = { version = "0.4.31", features = ["serde"] }
[features]
rocket = ["dep:rocket"]
diff --git a/common/src/lib.rs b/common/src/lib.rs
index 2bde0b9..8292e87 100644
--- a/common/src/lib.rs
+++ b/common/src/lib.rs
@@ -11,6 +11,9 @@ pub mod seek_index;
pub mod stream;
pub mod user;
+pub use chrono;
+
+use chrono::{DateTime, Utc};
#[cfg(feature = "rocket")]
use rocket::{FromFormField, UriDisplayQuery};
use serde::{Deserialize, Serialize};
@@ -42,6 +45,7 @@ pub struct NodePublic {
#[serde(default)] pub children: Vec<String>,
#[serde(default)] pub tagline: Option<String>,
#[serde(default)] pub description: Option<String>,
+ #[serde(default)] pub release_date: Option<DateTime<Utc>>,
#[serde(default)] pub index: Option<usize>,
#[serde(default)] pub media: Option<MediaInfo>,
#[serde(default)] pub ratings: BTreeMap<Rating, f64>,