diff options
Diffstat (limited to 'server/src/routes/ui/home.rs')
-rw-r--r-- | server/src/routes/ui/home.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/server/src/routes/ui/home.rs b/server/src/routes/ui/home.rs index b511467..8f8a876 100644 --- a/server/src/routes/ui/home.rs +++ b/server/src/routes/ui/home.rs @@ -5,7 +5,7 @@ */ use super::{ account::session::Session, - layout::LayoutPage, + layout::{trs, LayoutPage}, node::{DatabaseNodeUserDataExt, NodeCard}, }; use crate::{ @@ -43,7 +43,7 @@ pub fn r_home( let mut categories = Vec::<(String, Vec<_>)>::new(); categories.push(( - tr(lang, "home.bin.continue_watching").to_string(), + "home.bin.continue_watching".to_string(), items .iter() .filter(|(_, u)| matches!(u.watched, WatchedState::Progress(_))) @@ -51,7 +51,7 @@ pub fn r_home( .collect(), )); categories.push(( - tr(lang, "home.bin.watchlist").to_string(), + "home.bin.watchlist".to_string(), items .iter() .filter(|(_, u)| matches!(u.watched, WatchedState::Pending)) @@ -64,7 +64,7 @@ pub fn r_home( items.sort_by_key(|(n, _)| n.release_date.map(|d| -d).unwrap_or(i64::MAX)); categories.push(( - tr(lang, "home.bin.latest_video").to_string(), + "home.bin.latest_video".to_string(), items .iter() .filter(|(n, _)| matches!(n.kind, NodeKind::Video)) @@ -73,7 +73,7 @@ pub fn r_home( .collect(), )); categories.push(( - tr(lang, "home.bin.latest_music").to_string(), + "home.bin.latest_music".to_string(), items .iter() .filter(|(n, _)| matches!(n.kind, NodeKind::Music)) @@ -82,7 +82,7 @@ pub fn r_home( .collect(), )); categories.push(( - tr(lang, "home.bin.latest_short_form").to_string(), + "home.bin.latest_short_form".to_string(), items .iter() .filter(|(n, _)| matches!(n.kind, NodeKind::ShortFormVideo)) @@ -99,7 +99,7 @@ pub fn r_home( }); categories.push(( - tr(lang, "home.bin.max_rating").to_string(), + "home.bin.max_rating".to_string(), items .iter() .take(16) @@ -116,7 +116,7 @@ pub fn r_home( }); categories.push(( - tr(lang, "home.bin.daily_random").to_string(), + "home.bin.daily_random".to_string(), (0..16) .flat_map(|i| Some(items[cheap_daily_random(i).checked_rem(items.len())?].clone())) .collect(), @@ -126,7 +126,7 @@ pub fn r_home( let mut items = items.clone(); items.retain(|(_, u)| matches!(u.watched, WatchedState::Watched)); categories.push(( - tr(lang, "home.bin.watch_again").to_string(), + "home.bin.watch_again".to_string(), (0..16) .flat_map(|i| Some(items[cheap_daily_random(i).checked_rem(items.len())?].clone())) .collect(), @@ -135,7 +135,7 @@ pub fn r_home( items.retain(|(n, _)| matches!(n.kind, NodeKind::Music)); categories.push(( - tr(lang, "home.bin.daily_random_music").to_string(), + "home.bin.daily_random_music".to_string(), (0..16) .flat_map(|i| Some(items[cheap_daily_random(i).checked_rem(items.len())?].clone())) .collect(), @@ -156,7 +156,7 @@ pub fn r_home( }} @for (name, nodes) in &categories { @if !nodes.is_empty() { - h2 { @name } + h2 { @trs(&lang, &name) } ul.children.hlist {@for (node, udata) in nodes { li { @NodeCard { node, udata, lang: &lang } } }} |