pinakes-server: relativize media paths against configured root directories
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I9f113e6402030c46ad97f636985b5d6c6a6a6964
This commit is contained in:
parent
5077e9f117
commit
3aa1503441
11 changed files with 208 additions and 40 deletions
|
|
@ -126,5 +126,11 @@ pub async fn get_members(
|
|||
let items =
|
||||
pinakes_core::collections::get_members(&state.storage, collection_id)
|
||||
.await?;
|
||||
Ok(Json(items.into_iter().map(MediaResponse::from).collect()))
|
||||
let roots = state.config.read().await.directories.roots.clone();
|
||||
Ok(Json(
|
||||
items
|
||||
.into_iter()
|
||||
.map(|item| MediaResponse::new(item, &roots))
|
||||
.collect(),
|
||||
))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue