From 70d45003256b4ea9f3b3c2c99f845926bc1af6e1 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 10 Apr 2024 14:53:57 +0200 Subject: platzhalter --- server/src/routes/ui/node.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/server/src/routes/ui/node.rs b/server/src/routes/ui/node.rs index 3da72cd..9cc59c8 100644 --- a/server/src/routes/ui/node.rs +++ b/server/src/routes/ui/node.rs @@ -139,6 +139,11 @@ markup::define! { @node.title } } + div.subtitle { + a[href=uri!(r_library_node(id))] { + "Platzhalter" + } + } } } NodePage<'a>(id: &'a str, node: &'a NodePublic, node_ext: &'a ExtendedNode, udata: &'a NodeUserData, children: &'a [(String, NodePublic, NodeUserData)], path: &'a [(String, NodePublic)], filter: &'a NodeFilterSort) { @@ -355,12 +360,13 @@ impl MediaInfoExt for MediaInfo { match maxdim { 30720.. => "32K", 15360.. => "16K", - 7680.. => "8K", - 3840.. => "4K", - 2560.. => "WQHD", - 1920.. => "Full HD", + 7680.. => "8K UHD", + 5120.. => "5K UHD", + 3840.. => "4K UHD", + 2560.. => "QHD 1440p", + 1920.. => "FHD 1080p", 1280.. => "HD 720p", - 640.. => "NTSC", + 854.. => "SD 480p", _ => "Unkown", } } -- cgit v1.2.3-70-g09d2 From 50ae5ec326dbb034b325e73ffcc032b1167ddd9c Mon Sep 17 00:00:00 2001 From: tpart Date: Wed, 10 Apr 2024 15:35:11 +0200 Subject: Add subtitle style --- web/style/nodecard.css | 12 ++++++++++-- web/style/themes.css | 10 +++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/web/style/nodecard.css b/web/style/nodecard.css index ab25dd3..5a48f8f 100644 --- a/web/style/nodecard.css +++ b/web/style/nodecard.css @@ -30,13 +30,21 @@ object-position: center; width: 100%; } -.card .title { +.card .title, .card .subtitle { text-align: center; margin-top: 0.5em; text-align: center; text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; +} +.card .subtitle { + margin-top: 0.25em; +} +.card .subtitle a { + color: var(--font-dark); } -.card .title a { +.card .title a, .card .subtitle a { text-decoration-line: none; } .card .title a:hover { diff --git a/web/style/themes.css b/web/style/themes.css index f7c4229..10124b4 100644 --- a/web/style/themes.css +++ b/web/style/themes.css @@ -29,8 +29,8 @@ body.theme-Dark { --font-highlight: white; } body.theme-Light { - --accent-light: rgb(255, 163, 87); - --accent-dark: rgb(199, 90, 0); + --accent-light: #e46600; + --accent-dark: #ff9036; --c-error: rgb(255, 117, 117); --c-warn: rgb(252, 255, 78); --c-success: rgb(117, 255, 117); @@ -44,9 +44,9 @@ body.theme-Light { --background-very-light: #b9b9b9; --background-disable: rgb(128, 128, 128); --background-prop: #e9e9e9b2; - --font: rgb(43, 43, 43); - --font-dark: rgb(0, 0, 0); - --font-highlight: rgb(0, 0, 0); + --font: #0f0f0f; + --font-dark: #606060; + --font-highlight: black; } body.theme-Purple { --accent-light: rgb(191, 87, 255); -- cgit v1.2.3-70-g09d2 From 3e3064b7b8adc1354ba833a0903cc59d2ef6d83f Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 10 Apr 2024 19:14:11 +0200 Subject: add subtitles --- common/src/lib.rs | 5 +++-- import/src/lib.rs | 31 +++++++++++++++++++++++++++---- server/src/routes/ui/node.rs | 4 ++-- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/common/src/lib.rs b/common/src/lib.rs index 27ca24a..d06c40c 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -44,12 +44,13 @@ pub struct NodePublic { #[serde(default)] pub poster: Option, #[serde(default)] pub backdrop: Option, - + #[serde(default)] pub title: Option, + #[serde(default)] pub subtitle: Option, #[serde(default)] pub id: Option, #[serde(default)] pub path: Vec, - #[serde(default)] pub children: Vec, #[serde(default)] pub tagline: Option, + #[serde(default)] pub children: Vec, #[serde(default)] pub description: Option, #[serde(default)] pub release_date: Option, // in unix millis #[serde(default)] pub index: Option, diff --git a/import/src/lib.rs b/import/src/lib.rs index 33caa77..274b63d 100644 --- a/import/src/lib.rs +++ b/import/src/lib.rs @@ -21,6 +21,7 @@ use jellybase::{ }; use jellyclient::Session; use jellycommon::{ + chrono::{Datelike, NaiveDateTime}, Asset, ExtendedNode, ImportOptions, ImportSource, MediaInfo, Node, NodeKind, NodePrivate, NodePublic, PeopleGroup, Rating, SourceTrack, TmdbKind, TrackSource, TraktKind, }; @@ -143,7 +144,12 @@ pub fn merge_nodes(db: &DataAcid) -> anyhow::Result<()> { } pub fn generate_node_paths(db: &DataAcid) -> anyhow::Result<()> { - fn traverse(db: &DataAcid, c: String, mut path: Vec) -> anyhow::Result<()> { + fn traverse( + db: &DataAcid, + c: String, + mut path: Vec, + parent_title: &str, + ) -> anyhow::Result<()> { let node = { let txn = db.inner.begin_write()?; let mut table = txn.open_table(T_NODE)?; @@ -159,6 +165,22 @@ pub fn generate_node_paths(db: &DataAcid) -> anyhow::Result<()> { if node.public.path.is_empty() { node.public.path = path.clone(); } + node.public.subtitle = match node.public.kind.unwrap_or_default() { + NodeKind::Movie => node.public.release_date.map(|date| { + format!( + "{}", + NaiveDateTime::from_timestamp_millis(date) + .unwrap() + .date() + .year() + ) + }), + NodeKind::Season + | NodeKind::Episode + | NodeKind::ShortFormVideo + | NodeKind::Video => Some(parent_title.to_string()), + _ => None, + }; table.insert(c.as_str(), Ser(node.clone()))?; @@ -168,12 +190,13 @@ pub fn generate_node_paths(db: &DataAcid) -> anyhow::Result<()> { }; path.push(c); + let ps = node.public.title.unwrap_or_default(); for c in node.public.children { - traverse(db, c, path.clone())?; + traverse(db, c, path.clone(), &ps)?; } Ok(()) } - traverse(db, "library".to_string(), vec![])?; + traverse(db, "library".to_string(), vec![], "Root")?; Ok(()) } @@ -653,9 +676,9 @@ fn merge_node(x: Node, y: Node) -> anyhow::Result { public: NodePublic { kind: x.public.kind.or(y.public.kind), title: x.public.title.or(y.public.title), + subtitle: x.public.subtitle.or(y.public.subtitle), id: x.public.id.or(y.public.id), path: vec![], - children: merge_children(x.public.children, y.public.children), tagline: x.public.tagline.or(y.public.tagline), description: x.public.description.or(y.public.description), diff --git a/server/src/routes/ui/node.rs b/server/src/routes/ui/node.rs index 9cc59c8..327add0 100644 --- a/server/src/routes/ui/node.rs +++ b/server/src/routes/ui/node.rs @@ -140,8 +140,8 @@ markup::define! { } } div.subtitle { - a[href=uri!(r_library_node(id))] { - "Platzhalter" + span { + @node.subtitle } } } -- cgit v1.2.3-70-g09d2