now there are items and a bit of style to the library

This commit is contained in:
Chris Cochrun 2025-01-15 14:31:48 -06:00
parent 929b0a33d1
commit 40580a6e7a
7 changed files with 131 additions and 9 deletions

View file

@ -1,6 +1,8 @@
use crate::{Background, Slide, SlideBuilder, TextAlignment};
use super::{
content::Content,
kinds::ServiceItemKind,
model::{get_db, LibraryKind, Model},
service_items::ServiceTrait,
};
@ -20,6 +22,16 @@ pub struct Image {
pub path: PathBuf,
}
impl Content for Image {
fn title(&self) -> String {
self.title.clone()
}
fn kind(&self) -> ServiceItemKind {
ServiceItemKind::Image(self.clone())
}
}
impl From<Value> for Image {
fn from(value: Value) -> Self {
Self::from(&value)