From 5db15c323d76dca9ae71b0204d63dcb09fbbcbc5 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 29 Nov 2025 13:32:52 +0100 Subject: remove asset token; db json --- ui/src/node_page.rs | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'ui') diff --git a/ui/src/node_page.rs b/ui/src/node_page.rs index 1e029ae..e7e7b1d 100644 --- a/ui/src/node_page.rs +++ b/ui/src/node_page.rs @@ -13,7 +13,7 @@ use crate::{ props::Props, }; use jellycommon::{ - Chapter, Node, NodeKind, PeopleGroup, + Chapter, CreditCategory, IdentifierType, Node, NodeKind, api::NodeFilterSort, routes::{ u_node_slug, u_node_slug_backdrop, u_node_slug_person_asset, u_node_slug_player, @@ -119,7 +119,7 @@ markup::define! { @if !node.credits.is_empty() { h2 { @trs(lang, "node.people") } @for (group, people) in &node.credits { - details[open=group==&PeopleGroup::Cast] { + details[open=group==&CreditCategory::Cast] { summary { h3 { @format!("{}", group) } } ul.children.hlist { @for (i, pe) in people.iter().enumerate() { li { .card."aspect-port" { @@ -129,7 +129,7 @@ markup::define! { } } .title { - span { @pe.person.name } br; + // TODO span { @pe.person.name } br; @if let Some(c) = pe.characters.first() { span.subtitle { @c } } @@ -156,7 +156,7 @@ markup::define! { @for (key, value) in &node.identifiers { tr { tr { td { @trs(lang, &format!("eid.{}", key)) } - @if let Some(url) = external_id_url(key, value) { + @if let Some(url) = external_id_url(*key, value) { td { a[href=url] { pre { @value } } } } else { td { pre { @value } } @@ -216,16 +216,19 @@ pub fn aspect_class(kind: NodeKind) -> &'static str { } } -fn external_id_url(key: &str, value: &str) -> Option { +fn external_id_url(key: IdentifierType, value: &str) -> Option { Some(match key { - "youtube.video" => format!("https://youtube.com/watch?v={value}"), - "youtube.channel" => format!("https://youtube.com/channel/{value}"), - "youtube.channelname" => format!("https://youtube.com/channel/@{value}"), - "musicbrainz.release" => format!("https://musicbrainz.org/release/{value}"), - "musicbrainz.albumartist" => format!("https://musicbrainz.org/artist/{value}"), - "musicbrainz.artist" => format!("https://musicbrainz.org/artist/{value}"), - "musicbrainz.releasegroup" => format!("https://musicbrainz.org/release-group/{value}"), - "musicbrainz.recording" => format!("https://musicbrainz.org/recording/{value}"), + IdentifierType::YoutubeVideo => format!("https://youtube.com/watch?v={value}"), + IdentifierType::YoutubeChannel => format!("https://youtube.com/channel/{value}"), + IdentifierType::YoutubeChannelHandle => format!("https://youtube.com/channel/@{value}"), + IdentifierType::MusicbrainzRelease => format!("https://musicbrainz.org/release/{value}"), + IdentifierType::MusicbrainzArtist => format!("https://musicbrainz.org/artist/{value}"), + IdentifierType::MusicbrainzReleaseGroup => { + format!("https://musicbrainz.org/release-group/{value}") + } + IdentifierType::MusicbrainzRecording => { + format!("https://musicbrainz.org/recording/{value}") + } _ => return None, }) } -- cgit v1.3