fix
This commit is contained in:
parent
a1b597ef68
commit
c97f6168a1
1 changed files with 4 additions and 2 deletions
|
@ -9,6 +9,7 @@ use crate::check_admin;
|
||||||
use crate::library::track::Track;
|
use crate::library::track::Track;
|
||||||
use crate::library::user::User;
|
use crate::library::user::User;
|
||||||
use crate::library::Libary;
|
use crate::library::Libary;
|
||||||
|
use crate::route::to_api;
|
||||||
|
|
||||||
#[get("/library/clean")]
|
#[get("/library/clean")]
|
||||||
pub async fn clean_library(lib: &State<Libary>, u: User) -> FallibleApiResponse {
|
pub async fn clean_library(lib: &State<Libary>, u: User) -> FallibleApiResponse {
|
||||||
|
@ -23,12 +24,13 @@ pub async fn get_singles_route(u: User) -> FallibleApiResponse {
|
||||||
let singles = Track::find(doc! { "album_id": None::<String>}, None)
|
let singles = Track::find(doc! { "album_id": None::<String>}, None)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
Ok(json!(singles))
|
|
||||||
|
Ok(json!(to_api(&singles).await))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/library/orphans")]
|
#[get("/library/orphans")]
|
||||||
pub async fn get_orphans_route(u: User) -> FallibleApiResponse {
|
pub async fn get_orphans_route(u: User) -> FallibleApiResponse {
|
||||||
check_admin!(u);
|
check_admin!(u);
|
||||||
let orphans = Track::get_orphans().await;
|
let orphans = Track::get_orphans().await;
|
||||||
Ok(json!(orphans))
|
Ok(json!(to_api(&orphans).await))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue