diff options
Diffstat (limited to 'server/src/routes/ui/home.rs')
-rw-r--r-- | server/src/routes/ui/home.rs | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/server/src/routes/ui/home.rs b/server/src/routes/ui/home.rs index 0a1089a..6f70644 100644 --- a/server/src/routes/ui/home.rs +++ b/server/src/routes/ui/home.rs @@ -3,19 +3,14 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2024 metamuffin <metamuffin.org> */ -use super::{ - account::session::Session, - layout::LayoutPage, - node::{DatabaseNodeUserDataExt, NodeCard}, -}; +use super::{account::session::Session, layout::LayoutPage, node::NodeCard}; use crate::{ database::DataAcid, routes::ui::{error::MyResult, layout::DynLayoutPage}, }; -use anyhow::Context; use chrono::{Datelike, Utc}; use jellybase::{ - database::{redb::ReadableTable, TableExt, T_NODE, T_USER_NODE}, + database::{redb::ReadableTable, T_NODE, T_USER_NODE}, CONF, }; use jellycommon::{user::WatchedState, Rating}; @@ -38,7 +33,6 @@ pub fn r_home(sess: Session, db: &State<DataAcid>) -> MyResult<DynLayoutPage> { .unwrap() .map(|z| z.value().0) .unwrap_or_default(); - let y = y.public; (x, y, z) }) .collect::<Vec<_>>(); @@ -49,16 +43,14 @@ pub fn r_home(sess: Session, db: &State<DataAcid>) -> MyResult<DynLayoutPage> { .flat_map(|i| Some(items[cheap_daily_random(i).checked_rem(items.len())?].clone())) .collect::<Vec<_>>(); - let toplevel = T_NODE - .get(db, "library")? - .context("root node missing")? - .public - .children - .into_iter() - .map(|n| db.get_node_with_userdata(&n, &sess)) - .collect::<anyhow::Result<Vec<_>>>()? - .into_iter() - .collect::<Vec<_>>(); + // let toplevel = T_NODE + // .get(db, "library")? + // .context("root node missing")? + // .into_iter() + // .map(|n| db.get_node_with_userdata(&n, &sess)) + // .collect::<anyhow::Result<Vec<_>>>()? + // .into_iter() + // .collect::<Vec<_>>(); items.sort_by_key(|(_, n, _)| { n.ratings @@ -98,9 +90,9 @@ pub fn r_home(sess: Session, db: &State<DataAcid>) -> MyResult<DynLayoutPage> { title: "Home".to_string(), content: markup::new! { h2 { "Explore " @CONF.brand } - ul.children.hlist {@for (id, node, udata) in &toplevel { - li { @NodeCard { id, node, udata } } - }} + // ul.children.hlist {@for (id, node, udata) in &toplevel { + // li { @NodeCard { id, node, udata } } + // }} @if !continue_watching.is_empty() { h2 { "Continue Watching" } ul.children.hlist {@for (id, node, udata) in &continue_watching { |