Implement the repository for library item entity.
This commit is contained in:
@@ -2,7 +2,6 @@ use std::sync::{Arc, Mutex, MutexGuard};
|
||||
use rusqlite::{Connection, Error, Row};
|
||||
use rusqlite::fallible_iterator::FallibleIterator;
|
||||
use uuid::Uuid;
|
||||
use lumiere_domain::video::model::library_item::{LibraryItem, LibraryItemType};
|
||||
use crate::video::model::LibraryItemEntity;
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -35,7 +34,7 @@ impl LibraryItemSqliteRepository {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn get_all_of_root_folder(&self) -> Result<Vec<LibraryItem>, Error> {
|
||||
pub fn get_all_of_root_folder(&self) -> Result<Vec<LibraryItemEntity>, Error> {
|
||||
let database_connection = self.get_connection();
|
||||
|
||||
let mut prepared_statement = database_connection.prepare(
|
||||
@@ -47,7 +46,7 @@ impl LibraryItemSqliteRepository {
|
||||
WHERE parent_folder_id IS NULL",
|
||||
)?;
|
||||
let rows = prepared_statement.query([])?;
|
||||
rows.map(Self::map_to_library_item).collect::<Vec<LibraryItem>>()
|
||||
rows.map(Self::map_to_library_item).collect::<Vec<LibraryItemEntity>>()
|
||||
}
|
||||
|
||||
fn map_to_library_item(row: &Row) -> Result<LibraryItemEntity, Error> {
|
||||
|
||||
Reference in New Issue
Block a user