Display global statistics

This commit is contained in:
2025-05-02 10:01:22 +02:00
parent 16ef1147fe
commit 272c8ab312
8 changed files with 170 additions and 6 deletions

View File

@@ -112,6 +112,13 @@ pub async fn delete_file_if_unused(id: FileID) -> anyhow::Result<bool> {
}
}
/// Get all the files of a user
pub async fn get_all_files_user(user_id: UserID) -> anyhow::Result<Vec<File>> {
Ok(files::table
.filter(files::dsl::user_id.eq(user_id.0))
.load(&mut db()?)?)
}
/// Get the entire list of file
pub async fn get_entire_list() -> anyhow::Result<Vec<File>> {
Ok(files::table.get_results(&mut db()?)?)