17 lines
401 B
Rust
17 lines
401 B
Rust
|
use super::api_error;
|
||
|
use super::FallibleApiResponse;
|
||
|
use mongodb::bson::doc;
|
||
|
use rocket::{get, State};
|
||
|
use serde_json::json;
|
||
|
|
||
|
use crate::check_admin;
|
||
|
use crate::library::user::User;
|
||
|
use crate::library::Libary;
|
||
|
|
||
|
#[get("/library/clean")]
|
||
|
pub async fn clean_library(lib: &State<Libary>, u: User) -> FallibleApiResponse {
|
||
|
check_admin!(u);
|
||
|
lib.clean_lost_files().await;
|
||
|
Ok(json!({"ok": 1}))
|
||
|
}
|