Adds blake3 content hashing as the basis for derivative dedup (thumbnails, HLS) across libraries. Computed inline by the watcher on ingest and by a new `backfill_hashes` binary for historical rows. Key changes: - `content_hash` and `size_bytes` are now populated on new image_exif rows; a new ExifDao surface (`get_rows_missing_hash`, `backfill_content_hash`, `find_by_content_hash`) supports backfill and future hash-keyed lookups. - The watcher now registers every image/video in image_exif, not just files with parseable EXIF. EXIF becomes optional enrichment; videos and other non-EXIF files still get a hashed row. This also makes DB-indexed sort/filter cover the full library. - `/image` thumbnail serve dual-looks up hash-keyed path first, then falls back to the legacy mirrored layout. - Upload flow accepts `?library=` query param + hashes uploaded files. - Store_exif logs the underlying Diesel error on insert failure so constraint violations surface instead of hiding behind a generic InsertError. - New migration normalizes rel_path separators to forward slash across all tables, deduplicating any rows that collide after normalization. Fixes spurious UNIQUE violations from mixed backslash/forward-slash paths on Windows ingest. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
48 lines
942 B
Rust
48 lines
942 B
Rust
#[macro_use]
|
|
extern crate diesel;
|
|
|
|
pub mod ai;
|
|
pub mod auth;
|
|
pub mod cleanup;
|
|
pub mod content_hash;
|
|
pub mod data;
|
|
pub mod database;
|
|
pub mod error;
|
|
pub mod exif;
|
|
pub mod file_types;
|
|
pub mod files;
|
|
pub mod geo;
|
|
pub mod libraries;
|
|
pub mod memories;
|
|
pub mod otel;
|
|
pub mod parsers;
|
|
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]) {
|
|
// Stub - implemented in main.rs
|
|
}
|
|
|
|
pub fn update_media_counts(_media_dir: &Path) {
|
|
// Stub - implemented in main.rs
|
|
}
|
|
|
|
pub fn is_video(entry: &DirEntry) -> bool {
|
|
file_types::direntry_is_video(entry)
|
|
}
|