Implement the repository for library item entity.

This commit is contained in:
Florian THIERRY
2026-07-17 11:28:27 +02:00
parent 56d5abe964
commit 4abd7dc5b9
4 changed files with 25 additions and 12 deletions
@@ -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> {