Merge FS and DB library raw items.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use std::fs::File;
|
||||
use std::io::{Error, ErrorKind};
|
||||
use uuid::Uuid;
|
||||
use lumiere_domain::video::model::library_item::{LibraryItem, LibraryItemType};
|
||||
use lumiere_domain::video::model::library_item::{LibraryItem, LibraryItemType, LibraryRawItem};
|
||||
|
||||
pub struct TokioVideoFile {
|
||||
pub file: File
|
||||
@@ -50,9 +50,9 @@ impl LibraryItemEntity {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn to_library_item(&self) -> Result<LibraryItem, Error> {
|
||||
let library_item = LibraryItem {
|
||||
id: self.id.clone(),
|
||||
pub(crate) fn to_library_raw_item(self) -> Result<LibraryRawItem, Error> {
|
||||
let library_item = LibraryRawItem {
|
||||
id: Some(self.id.clone()),
|
||||
name: self.name.clone(),
|
||||
r#type: Self::map_type_from_i8(self.r#type)?
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user