New module that consolidates the four-step ingest waterfall: kamadak-exif (already in process via the caller's prior result) → exiftool fallback → filename regex → earliest_fs_time. Each step is tagged with a `DateSource` so the caller can persist provenance. The exiftool fallback is what makes videos and MakerNote-hosted dates land at all — kamadak-exif can't read QuickTime/MP4 or Nikon-style sub-IFDs. Single-file mode shells out per call; batch mode pipes paths on stdin via `-@ -` and fans the result through one subprocess so the upcoming per-tick drain doesn't pay startup cost per row. The `exiftool` PATH check is cached in a `OnceLock` to keep the drain short-circuited on deploys without exiftool installed. `SubSecDateTimeOriginal` and `ContentCreateDate` are pulled alongside the standard tags to capture iPhone's sub-second precision and Apple's preferred capture-time tag respectively. `FileModifyDate` is deliberately *not* in the tag list — it's a filesystem-derived value the resolver already covers via the `fs_time` step, and pulling it through exiftool would mask "no real EXIF date" with a misleading `source = exiftool` row. Module is registered in both `lib.rs` and `main.rs` (sibling-module pattern the rest of the bin uses); no callers wired in yet — that lands in the next commit. Comes with 9 unit tests covering JSON parsing edge cases, source-priority short-circuiting, and the fs_time-when-no-exif path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
58 lines
1.2 KiB
Rust
58 lines
1.2 KiB
Rust
#![allow(clippy::too_many_arguments)]
|
|
|
|
#[macro_use]
|
|
extern crate diesel;
|
|
|
|
pub mod ai;
|
|
pub mod auth;
|
|
pub mod bin_progress;
|
|
pub mod cleanup;
|
|
pub mod content_hash;
|
|
pub mod data;
|
|
pub mod database;
|
|
pub mod date_resolver;
|
|
pub mod duplicates;
|
|
pub mod error;
|
|
pub mod exif;
|
|
pub mod face_watch;
|
|
pub mod faces;
|
|
pub mod file_scan;
|
|
pub mod file_types;
|
|
pub mod files;
|
|
pub mod geo;
|
|
pub mod libraries;
|
|
pub mod library_maintenance;
|
|
pub mod memories;
|
|
pub mod otel;
|
|
pub mod parsers;
|
|
pub mod perceptual_hash;
|
|
pub mod service;
|
|
pub mod state;
|
|
pub mod tags;
|
|
#[cfg(test)]
|
|
pub mod testhelpers;
|
|
pub mod utils;
|
|
pub mod video;
|
|
|
|
// Re-export commonly used types
|
|
pub use data::{Claims, ThumbnailRequest};
|
|
pub use database::{connect, schema};
|
|
pub use state::AppState;
|
|
|
|
// Stub functions for modules that reference main.rs
|
|
// These are not used by cleanup_files binary
|
|
use std::path::Path;
|
|
use walkdir::DirEntry;
|
|
|
|
pub fn create_thumbnails(_libs: &[libraries::Library], _excluded_dirs: &[String]) {
|
|
// Stub - implemented in main.rs
|
|
}
|
|
|
|
pub fn update_media_counts(_media_dir: &Path, _excluded_dirs: &[String]) {
|
|
// Stub - implemented in main.rs
|
|
}
|
|
|
|
pub fn is_video(entry: &DirEntry) -> bool {
|
|
file_types::direntry_is_video(entry)
|
|
}
|