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
@@ -1,3 +1,4 @@
use std::io::Read;
use uuid::Uuid;
pub enum LibraryItemType {
@@ -15,4 +16,13 @@ pub struct ReadLibraryItem {
pub id: Option<Uuid>,
pub name: String,
pub r#type: LibraryItemType,
}
impl ReadLibraryItem {
pub fn map_to_library_item(&self) -> LibraryItem {
LibraryItem {
id: self.id.unwrap_or(Uuid::new_v4()),
name: self.name,
r#type: self.r#type,
}
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ pub trait VideoPort: Send + Sync {
fn list_root_folder(&self) -> Result<Vec<ReadLibraryItem>, VideoError>;
fn list_folder(&self, folder_id: Uuid) -> Result<Vec<ReadLibraryItem>, VideoError>;
fn get_video_stream(&self, video_id: Uuid) -> Result<Video, VideoError>;
fn save(&self, library_item: LibraryItem) -> Result<(), VideoError>;
fn save(&self, library_item: &LibraryItem) -> Result<(), VideoError>;
fn clone_box(&self) -> Box<dyn VideoPort>;
}