fixing lots of little issues
Some checks are pending
/ test (push) Waiting to run

This commit is contained in:
Chris Cochrun 2025-09-18 14:10:08 -05:00
parent 28a18819cf
commit 7d8c2243d8
5 changed files with 95 additions and 26 deletions

View file

@ -178,9 +178,44 @@ impl<'a> Library {
})
.ok()
}
LibraryKind::Video => todo!(),
LibraryKind::Image => todo!(),
LibraryKind::Presentation => todo!(),
LibraryKind::Video => {
let video = Video::default();
self.video_library
.add_item(video)
.map(|_| {
let index =
self.video_library.items.len();
(LibraryKind::Video, index as i32)
})
.ok()
}
LibraryKind::Image => {
let image = Image::default();
self.image_library
.add_item(image)
.map(|_| {
let index =
self.image_library.items.len();
(LibraryKind::Image, index as i32)
})
.ok()
}
LibraryKind::Presentation => {
let presentation = Presentation::default();
self.presentation_library
.add_item(presentation)
.map(|_| {
let index = self
.presentation_library
.items
.len();
(
LibraryKind::Presentation,
index as i32,
)
})
.ok()
}
};
return self.update(Message::OpenItem(item));
}