Start to implement the VideoService list_root_folder method.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
use uuid::Uuid;
|
||||
|
||||
pub struct FolderItem {
|
||||
pub id: Option<Uuid>,
|
||||
pub name: String,
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
use uuid::Uuid;
|
||||
|
||||
pub enum LibraryItemType {
|
||||
VIDEO,
|
||||
FOLDER
|
||||
}
|
||||
|
||||
pub struct LibraryItem {
|
||||
pub id: Uuid,
|
||||
pub name: String,
|
||||
pub r#type: LibraryItemType,
|
||||
}
|
||||
|
||||
pub struct ReadLibraryItem {
|
||||
pub id: Option<Uuid>,
|
||||
pub name: String,
|
||||
pub r#type: LibraryItemType,
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
pub mod folder;
|
||||
pub mod library_item;
|
||||
pub mod video;
|
||||
@@ -12,7 +12,7 @@ pub trait VideoFile {}
|
||||
|
||||
pub struct Video {
|
||||
pub id: Uuid,
|
||||
pub filename: String,
|
||||
pub name: String,
|
||||
pub file: Box<dyn VideoFile>,
|
||||
pub format: VideoFormat,
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
use uuid::Uuid;
|
||||
use crate::video::error::VideoError;
|
||||
use crate::video::model::Video;
|
||||
use crate::video::model::library_item::{LibraryItem, ReadLibraryItem};
|
||||
use crate::video::model::video::Video;
|
||||
|
||||
pub trait VideoPort: Send + Sync {
|
||||
fn list_root(&self) -> Result<Vec<Video>, VideoError>;
|
||||
fn list_folder(&self, folder_id: Uuid) -> Result<Vec<Video>, VideoError>;
|
||||
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 clone_box(&self) -> Box<dyn VideoPort>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user