Implement the service to list items in the root folder.

This commit is contained in:
Florian THIERRY
2026-07-14 14:50:37 +02:00
parent 2df12118eb
commit f76200e64a
6 changed files with 76 additions and 13 deletions
@@ -0,0 +1,55 @@
use lumiere_domain::video::error::VideoError;
use lumiere_domain::video::model::library_item::{LibraryItem, ReadLibraryItem};
use lumiere_domain::video::model::video::Video;
use lumiere_domain::video::port::VideoPort;
use uuid::Uuid;
pub struct VideoAdapter {
}
impl VideoAdapter {
pub fn new() -> Self {
Self {}
}
pub fn get_root_folder_read_library_items(&self) -> Result<Vec<ReadLibraryItem>, VideoError> {
// get the root_folder path from the environment variable named "ROOT_FOLDER"
// list all elements inside this folder on the file system
// map all those elements into ReadLibraryItem objects
// return the list
todo!()
}
pub fn get_all_library_items_from_db(&self) -> Result<Vec<ReadLibraryItem>, VideoError> {
todo!()
}
}
impl VideoPort for VideoAdapter {
fn list_root_folder(&self) -> Result<Vec<ReadLibraryItem>, VideoError> {
// In parallel:
// - call method "get_root_folder_read_library_items()"
// - call method "get_all_library_items_from_db()"
//
// then, merge the two lists. If an item from the "get_root_folder_read_library_items()" result has the same id as an item from the "get_all_library_items_from_db()" results, merge those two items in one single.
// return the merged list
todo!()
}
fn list_folder(&self, folder_id: Uuid) -> Result<Vec<ReadLibraryItem>, VideoError> {
todo!()
}
fn get_video_stream(&self, video_id: Uuid) -> Result<Video, VideoError> {
todo!()
}
fn save(&self, library_item: LibraryItem) -> Result<(), VideoError> {
todo!()
}
fn clone_box(&self) -> Box<dyn VideoPort> {
todo!()
}
}