aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/ui/node.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-08-07 13:46:22 +0200
committermetamuffin <metamuffin@disroot.org>2023-08-07 13:46:22 +0200
commita2e557e648cf253d47e9f4b9dd99ee657610f294 (patch)
tree350fe5868c9f7d890c79b2489b307c263ed7c307 /server/src/routes/ui/node.rs
parent908db5458b07d7a13f24c755d340ab3c1917e8a8 (diff)
downloadjellything-a2e557e648cf253d47e9f4b9dd99ee657610f294.tar
jellything-a2e557e648cf253d47e9f4b9dd99ee657610f294.tar.bz2
jellything-a2e557e648cf253d47e9f4b9dd99ee657610f294.tar.zst
extend sort and filter
Diffstat (limited to 'server/src/routes/ui/node.rs')
-rw-r--r--server/src/routes/ui/node.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/server/src/routes/ui/node.rs b/server/src/routes/ui/node.rs
index 13afbbe..e14a2af 100644
--- a/server/src/routes/ui/node.rs
+++ b/server/src/routes/ui/node.rs
@@ -33,12 +33,13 @@ pub fn r_library_node(id: String) {
#[get("/n/<id>?<filter..>")]
pub async fn r_library_node_filter(
- _sess: Session,
+ session: Session,
id: String,
db: &State<Database>,
aj: AcceptJson,
filter: NodeFilterSort,
) -> Result<Either<DynLayoutPage<'_>, Json<NodePublic>>, MyError> {
+ drop(session);
let node = db
.node
.get(&id)
@@ -149,14 +150,14 @@ markup::define! {
p { @format_duration(m.duration) }
p { @m.resolution_name() }
}
- @for r in &node.ratings {
- p { @match r {
- Rating::YoutubeLikes(n) => { @format_count(*n) " Likes" }
- Rating::YoutubeViews(n) => { @format_count(*n) " Views" }
- Rating::YoutubeFollowers(n) => { @format_count(*n) " Subscribers" }
- Rating::RottenTomatoes(n) => { @n " Tomatoes" }
- Rating::Metacritic(n) => { "Metacritic Score: " @n }
- Rating::Imdb(n) => { "IMDb Rating: " @n }
+ @for (kind, value) in &node.ratings {
+ p { @match kind {
+ Rating::YoutubeLikes => { @format_count(*value as usize) " Likes" }
+ Rating::YoutubeViews => { @format_count(*value as usize) " Views" }
+ Rating::YoutubeFollowers => { @format_count(*value as usize) " Subscribers" }
+ Rating::RottenTomatoes => { @value " Tomatoes" }
+ Rating::Metacritic => { "Metacritic Score: " @value }
+ Rating::Imdb => { "IMDb Rating: " @value }
} }
}
}