Initial 2

This commit is contained in:
Jackzie 2025-04-14 16:25:04 -05:00
commit 98d0065f55
53 changed files with 5857 additions and 0 deletions

28
server/src/library.rs Normal file
View file

@ -0,0 +1,28 @@
use std::collections::HashMap;
use crate::{models, DB};
use crate::objs::repo::{Repo};
use crate::storage::StorageBackend;
use crate::user::User;
pub struct Library {
pub repo: Repo,
pub name: String,
pub owner: User,
// permissions:
}
// pub async fn get_library(pool: &DB, library_id: &str) -> Result<Option<Library>, anyhow::Error> {
// let library = models::library::get_library(pool, library_id)?;
// let Some(library) = library else {
// return Ok(None)
// };
// let repo = get_repo(pool, &library.repo_id).await?
// .ok_or(anyhow::Error::msg("Repository not found."))?;
// let owner = get_owner(pool, &library.owner_id).await?
// .ok_or(anyhow::Error::msg("Owner not found."))?;
// Ok(Some(Library {
// repo: repo,
// name: library.name,
// owner: (),
// }))
// }