a fledgling visible library system

Why do I write these weird commit messages....
This commit is contained in:
Chris Cochrun 2025-01-14 15:03:59 -06:00
parent 201e9dc925
commit 89294061b7
7 changed files with 188 additions and 55 deletions

View file

@ -6,12 +6,20 @@ use sqlx::{Connection, SqliteConnection};
use super::kinds::ServiceItemKind;
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Model<T> {
pub items: Vec<T>,
pub db: SqliteConnection,
pub kind: ServiceItemKind,
pub kind: LibraryKind,
}
#[derive(Debug, Clone)]
pub enum LibraryKind {
Song,
Video,
Image,
Presentation,
}
impl<T> Model<T> {
pub fn add_item(&mut self, item: T) -> Result<()> {
self.items.push(item);