Improve media indexing and processing flow

This commit is contained in:
2026-04-05 18:58:10 +01:00
parent c299c7d452
commit c4036140e6
18 changed files with 1663 additions and 472 deletions
+2 -6
View File
@@ -37,7 +37,6 @@ pub async fn add_folder(
app: AppHandle,
db: State<'_, DbState>,
path: String,
cache_dir: String,
) -> Result<Folder, String> {
let folder_path = PathBuf::from(&path);
@@ -65,8 +64,7 @@ pub async fn add_folder(
.find(|f| f.id == folder_id)
.ok_or("Folder not found after insert")?;
let cache_path = PathBuf::from(cache_dir);
indexer::index_folder(app, db.inner().clone(), folder_id, folder_path, cache_path);
indexer::index_folder(app, db.inner().clone(), folder_id, folder_path);
Ok(folder)
}
@@ -135,7 +133,6 @@ pub async fn reindex_folder(
app: AppHandle,
db: State<'_, DbState>,
folder_id: i64,
cache_dir: String,
) -> Result<(), String> {
let folder_path = {
let conn = db.get().map_err(|e| e.to_string())?;
@@ -147,7 +144,6 @@ pub async fn reindex_folder(
.ok_or("Folder not found")?
};
let cache_path = PathBuf::from(cache_dir);
indexer::index_folder(app, db.inner().clone(), folder_id, folder_path, cache_path);
indexer::index_folder(app, db.inner().clone(), folder_id, folder_path);
Ok(())
}