WIP Implement the video adapter to merge FS files and DB files.
This commit is contained in:
@@ -12,12 +12,12 @@ pub struct LibraryItem {
|
||||
pub r#type: LibraryItemType,
|
||||
}
|
||||
|
||||
pub struct ReadLibraryItem {
|
||||
pub struct LibraryRawItem {
|
||||
pub id: Option<Uuid>,
|
||||
pub name: String,
|
||||
pub r#type: LibraryItemType,
|
||||
}
|
||||
impl ReadLibraryItem {
|
||||
impl LibraryRawItem {
|
||||
pub fn map_to_library_item(&self) -> LibraryItem {
|
||||
LibraryItem {
|
||||
id: self.id.unwrap_or(Uuid::new_v4()),
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use uuid::Uuid;
|
||||
use crate::video::error::VideoError;
|
||||
use crate::video::model::library_item::{LibraryItem, ReadLibraryItem};
|
||||
use crate::video::model::library_item::{LibraryItem, LibraryRawItem};
|
||||
use crate::video::model::video::Video;
|
||||
|
||||
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 list_root_folder(&self) -> Result<Vec<LibraryRawItem>, VideoError>;
|
||||
fn list_folder(&self, folder_id: Uuid) -> Result<Vec<LibraryRawItem>, 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