+
+ 0 ? "warning" : "default"} />
0 ? "error" : "default"} />
diff --git a/apps/backoffice/lib/api.ts b/apps/backoffice/lib/api.ts
index eb66d27..5358f09 100644
--- a/apps/backoffice/lib/api.ts
+++ b/apps/backoffice/lib/api.ts
@@ -25,6 +25,7 @@ export type IndexJobDto = {
indexed_files: number;
removed_files: number;
errors: number;
+ warnings: number;
} | null;
progress_percent: number | null;
processed_files: number | null;
diff --git a/apps/indexer/src/job.rs b/apps/indexer/src/job.rs
index 2096d8f..eea13e7 100644
--- a/apps/indexer/src/job.rs
+++ b/apps/indexer/src/job.rs
@@ -292,6 +292,7 @@ pub async fn process_job(
indexed_files: 0,
removed_files: 0,
errors: 0,
+ warnings: 0,
};
let mut total_processed_count = 0i32;
diff --git a/apps/indexer/src/scanner.rs b/apps/indexer/src/scanner.rs
index 3c15735..979206a 100644
--- a/apps/indexer/src/scanner.rs
+++ b/apps/indexer/src/scanner.rs
@@ -1,4 +1,4 @@
-use anyhow::{Context, Result};
+use anyhow::Result;
use chrono::{DateTime, Utc};
use parsers::{detect_format, parse_metadata_fast};
use serde::Serialize;
@@ -21,6 +21,7 @@ pub struct JobStats {
pub indexed_files: usize,
pub removed_files: usize,
pub errors: usize,
+ pub warnings: usize,
}
const BATCH_SIZE: usize = 100;
@@ -205,8 +206,14 @@ pub async fn scan_library_discovery(
.map(|s| s.to_string_lossy().to_string())
.unwrap_or_else(|| abs_path.clone());
- let metadata = std::fs::metadata(&path)
- .with_context(|| format!("cannot stat {}", path.display()))?;
+ let metadata = match std::fs::metadata(&path) {
+ Ok(m) => m,
+ Err(e) => {
+ warn!("[SCAN] cannot stat {}, skipping: {}", path.display(), e);
+ stats.warnings += 1;
+ continue;
+ }
+ };
let mtime: DateTime
= metadata
.modified()
.map(DateTime::::from)