From c180123e07c31ff45194e1645a4b90c3fd039650 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 30 Sep 2023 09:11:34 +0200 Subject: update api --- api.md | 14 ++++++++------ server/src/routes/ui/node.rs | 10 +++++----- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/api.md b/api.md index acae575..1dcdb41 100644 --- a/api.md +++ b/api.md @@ -26,13 +26,15 @@ seconds). The Response contains the session cookie as a string in JSON. ## GET* `/n/` -Request a library node (either a directory or item). See -[`common/src/api.rs`](./common/src/api.rs) +Request a library node (either a directory or item). Returns it as `NodePublic`. -## GET* `/n//asset?` +## GET* `/n//asset?&` -Where `role` is one of `backdrop` or `poster`. Returns assets for a node. +Where `role` is one of `backdrop` or `poster` and `width` is the width of the +resolution you want to image to be in. The actual returned resolution must not +be exactly what you requested. Returns assets for a node. -## GET* `/stream/?tracks=&webm=` +## GET* `/stream/?&&&&` -Responds with the stream directly or a redirect to the actual source. +Responds with the stream directly or a redirect to the actual source in case of +federation. diff --git a/server/src/routes/ui/node.rs b/server/src/routes/ui/node.rs index 7386f54..1a906f1 100644 --- a/server/src/routes/ui/node.rs +++ b/server/src/routes/ui/node.rs @@ -32,17 +32,17 @@ pub fn r_library_node(id: String) { } #[get("/n/?")] -pub async fn r_library_node_filter( +pub async fn r_library_node_filter<'a>( session: Session, - id: String, - db: &State, + id: &'a str, + db: &'a State, aj: AcceptJson, filter: NodeFilterSort, -) -> Result, Json>, MyError> { +) -> Result, Json>, MyError> { drop(session); let node = db .node - .get(&id) + .get(&id.to_string()) .context("retrieving library node")? .ok_or(anyhow!("node does not exist"))? .public; -- cgit v1.2.3-70-g09d2