aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/stream.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-01-20 00:50:20 +0100
committermetamuffin <metamuffin@disroot.org>2024-01-20 00:50:20 +0100
commit46c251655db7bb3d9aa814b1a5dde85336b0b9b1 (patch)
treeab0696f2c92e8854ce6aa0737877cc15184bd8b6 /server/src/routes/stream.rs
parent1c37d32a0985ff7390313833345b9299f9f0b196 (diff)
downloadjellything-46c251655db7bb3d9aa814b1a5dde85336b0b9b1.tar
jellything-46c251655db7bb3d9aa814b1a5dde85336b0b9b1.tar.bz2
jellything-46c251655db7bb3d9aa814b1a5dde85336b0b9b1.tar.zst
replace sled with redb
Diffstat (limited to 'server/src/routes/stream.rs')
-rw-r--r--server/src/routes/stream.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/src/routes/stream.rs b/server/src/routes/stream.rs
index e8b14b5..c033bda 100644
--- a/server/src/routes/stream.rs
+++ b/server/src/routes/stream.rs
@@ -4,9 +4,10 @@
Copyright (C) 2023 metamuffin <metamuffin.org>
*/
use super::ui::{account::session::Session, error::MyError};
-use crate::database::Database;
+use crate::database::DataAcid;
use anyhow::{anyhow, Result};
use jellybase::{
+ database::{TableExt, T_NODE},
federation::Federation,
permission::{NodePermissionExt, PermissionSetExt},
CONF,
@@ -46,14 +47,13 @@ pub async fn r_stream_head(
pub async fn r_stream(
session: Session,
federation: &State<Federation>,
- db: &State<Database>,
+ db: &State<DataAcid>,
id: &str,
range: Option<RequestRange>,
spec: StreamSpec,
) -> Result<Either<StreamResponse, RedirectResponse>, MyError> {
- let node = db
- .node
- .get(&id.to_string())?
+ let node = T_NODE
+ .get(&db, id)?
.only_if_permitted(&session.user.permissions)
.ok_or(anyhow!("node does not exist"))?;
let source = node