aboutsummaryrefslogtreecommitdiff
path: root/ui/src/components/node_page.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/components/node_page.rs')
-rw-r--r--ui/src/components/node_page.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/ui/src/components/node_page.rs b/ui/src/components/node_page.rs
index 5cd71ce..2a5848b 100644
--- a/ui/src/components/node_page.rs
+++ b/ui/src/components/node_page.rs
@@ -6,7 +6,7 @@
use crate::{RenderInfo, components::props::Props, page};
use jellycommon::{
- jellyobject::{Object, Tag, TypedTag},
+ jellyobject::{EMPTY, Object, Tag, TypedTag},
routes::{u_image, u_node_slug_player},
*,
};
@@ -30,9 +30,9 @@ page!(Player<'_>, |x| x
markup::define! {
NodePage<'a>(ri: &'a RenderInfo<'a>, nku: Nku<'a>) {
- @let node = nku.node;
+ @let node = &nku.node;
@let slug = node.get(NO_SLUG).unwrap_or_default();
- @let pics = node.get(NO_PICTURES).unwrap_or_default();
+ @let pics = node.get(NO_PICTURES).unwrap_or(EMPTY);
@if let Some(path) = pics.get(PICT_BACKDROP) {
img.backdrop[src=u_image(path, 2048)];
}
@@ -106,7 +106,7 @@ markup::define! {
details {
summary { @tr(ri.lang, "tag.iden") }
table {
- @for (key, value) in idents.entries::<&str>() { tr {
+ @for (key, value) in idents.entries::<str>() { tr {
td { @tr(ri.lang, &format!("tag.iden.{key}")) }
@if let Some(url) = external_id_url(key, value) {
td { a[href=url] { pre { @value } } }
@@ -130,13 +130,13 @@ markup::define! {
summary { @tr(ri.lang, "tag.msrc") }
table {
tr { th {"Attribute"} th {"Source"} }
- @for (key, source) in node.get(NO_METASOURCE).unwrap_or_default().entries::<Tag>() { tr {
+ @for (key, source) in node.get(NO_METASOURCE).unwrap_or(EMPTY).entries::<Tag>() { tr {
td { @tr(ri.lang, &format!("tag.{key}")) }
td { @tr(ri.lang, &format!("tag.msrc.{source}")) }
}}
@for nkey in [NO_PICTURES, NO_IDENTIFIERS, NO_RATINGS] {
- @let nob = node.get(nkey).unwrap_or_default();
- @for (key, source) in nob.get(NO_METASOURCE).unwrap_or_default().entries::<Tag>() { tr {
+ @let nob = node.get(nkey).unwrap_or(EMPTY);
+ @for (key, source) in nob.get(NO_METASOURCE).unwrap_or(EMPTY).entries::<Tag>() { tr {
td { @tr(ri.lang, &format!("tag.{nkey}")) ": " @tr(ri.lang, &format!("tag.{nkey}.{key}")) }
td { @tr(ri.lang, &format!("tag.msrc.{source}")) }
}}
@@ -158,7 +158,7 @@ markup::define! {
Player<'a>(ri: &'a RenderInfo<'a>, nku: Nku<'a>) {
@let _ = ri;
- @let pics = nku.node.get(NO_PICTURES).unwrap_or_default();
+ @let pics = nku.node.get(NO_PICTURES).unwrap_or(EMPTY);
video[id="player", poster=pics.get(PICT_COVER).map(|p| u_image(p, 2048))] {}
}
}
@@ -169,7 +169,7 @@ markup::define! {
// start * 0.8 + end * 0.2
// }
-pub fn aspect_class(node: Object<'_>) -> &'static str {
+pub fn aspect_class(node: &Object) -> &'static str {
let kind = node.get(NO_KIND).unwrap_or(KIND_COLLECTION);
match kind {
KIND_VIDEO | KIND_EPISODE => "aspect-thumb",