aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/ui/home.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-29 16:07:58 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-29 16:07:58 +0100
commite7ba3274e27fad755f15465581f5b403c82ab4d2 (patch)
treef2d693c61786ee6ed027636393fd75f086bd77e8 /server/src/routes/ui/home.rs
parent5ac3f397b4a28b7bf8b399e73ad0d29e3da45ab0 (diff)
downloadjellything-e7ba3274e27fad755f15465581f5b403c82ab4d2.tar
jellything-e7ba3274e27fad755f15465581f5b403c82ab4d2.tar.bz2
jellything-e7ba3274e27fad755f15465581f5b403c82ab4d2.tar.zst
prepare database refactor
Diffstat (limited to 'server/src/routes/ui/home.rs')
-rw-r--r--server/src/routes/ui/home.rs34
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 {