This commit is contained in:
JMARyA 2024-08-16 12:57:01 +02:00
parent c97f6168a1
commit 636ad0bf34
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263

View file

@ -21,9 +21,12 @@ pub async fn clean_library(lib: &State<Libary>, u: User) -> FallibleApiResponse
#[get("/library/singles")] #[get("/library/singles")]
pub async fn get_singles_route(u: User) -> FallibleApiResponse { pub async fn get_singles_route(u: User) -> FallibleApiResponse {
check_admin!(u); check_admin!(u);
let singles = Track::find(doc! { "album_id": None::<String>}, None) let singles = Track::find(
.await doc! { "album_id": None::<String>, "artist_id": {"$ne": None::<String> }},
.unwrap(); None,
)
.await
.unwrap();
Ok(json!(to_api(&singles).await)) Ok(json!(to_api(&singles).await))
} }