From 614630bea8169b98c5767590b7e7ba639aafd216 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Tue, 18 Feb 2025 17:03:08 -0600 Subject: [PATCH] Setting up ServiceItem to lisp Value --- src/core/service_items.rs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/core/service_items.rs b/src/core/service_items.rs index 70c1e6b..c49c6c3 100644 --- a/src/core/service_items.rs +++ b/src/core/service_items.rs @@ -56,13 +56,23 @@ impl AsMimeTypes for ServiceItem { &self, mime_type: &str, ) -> Option> { - todo!(); debug!(?self); debug!(mime_type); - Some(Cow::from( - r#"(slide :background (image :source "~/pics/frodo.jpg" :fit fill) - (text "This is frodo" :font-size 70))"#.to_string().into_bytes() - )) + let val = Value::from(self); + let val = String::from(val); + Some(Cow::from(val.into_bytes())) + } +} + +impl From<&ServiceItem> for Value { + fn from(value: &ServiceItem) -> Self { + match &value.kind { + ServiceItemKind::Song(song) => todo!(), + ServiceItemKind::Video(video) => todo!(), + ServiceItemKind::Image(image) => todo!(), + ServiceItemKind::Presentation(presentation) => todo!(), + ServiceItemKind::Content(slide) => todo!(), + } } }