fix: resolve media across libraries for video, metadata, and insights
The /video/generate and /image/metadata handlers assumed files live under the resolved library only, which broke when a mobile client passed no library (union mode) but the file lived in a non-primary library. Both now fall back to scanning every configured library for an existing file. InsightGenerator held a single base_path, so vision-model loads and filename-date fallbacks failed for non-primary libraries. It now takes Vec<Library> and probes each root in resolve_full_path. /image/metadata responses now carry library_id/library_name so the mobile viewer can surface which library a file belongs to. Thumbnail generation at startup is now spawned on a background thread so the HTTP server can accept traffic while large libraries backfill. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -239,6 +239,8 @@ pub struct MetadataResponse {
|
||||
pub size: u64,
|
||||
pub exif: Option<ExifMetadata>,
|
||||
pub filename_date: Option<i64>, // Date extracted from filename
|
||||
pub library_id: Option<i32>,
|
||||
pub library_name: Option<String>,
|
||||
}
|
||||
|
||||
impl From<fs::Metadata> for MetadataResponse {
|
||||
@@ -255,6 +257,8 @@ impl From<fs::Metadata> for MetadataResponse {
|
||||
size: metadata.len(),
|
||||
exif: None,
|
||||
filename_date: None, // Will be set in endpoint handler
|
||||
library_id: None,
|
||||
library_name: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user