aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-11-29 13:32:52 +0100
committermetamuffin <metamuffin@disroot.org>2025-11-29 13:32:52 +0100
commit5db15c323d76dca9ae71b0204d63dcb09fbbcbc5 (patch)
tree4f69e58c9b6825b7b602712893950673abf9c286 /ui
parentbac47e456085ea153ae6ae1b1e28e41868693c9c (diff)
downloadjellything-5db15c323d76dca9ae71b0204d63dcb09fbbcbc5.tar
jellything-5db15c323d76dca9ae71b0204d63dcb09fbbcbc5.tar.bz2
jellything-5db15c323d76dca9ae71b0204d63dcb09fbbcbc5.tar.zst
remove asset token; db json
Diffstat (limited to 'ui')
-rw-r--r--ui/src/node_page.rs29
1 files changed, 16 insertions, 13 deletions
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<String> {
+fn external_id_url(key: IdentifierType, value: &str) -> Option<String> {
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,
})
}