fix: startup crash, watcher count, timeline date fallback
db.rs: - Move idx_images_taken_at creation to after ensure_column so it never runs against a schema where taken_at doesn't exist yet; this was causing a startup panic on any DB that predates Phase 1 - COALESCE(taken_at, created_at) → COALESCE(taken_at, modified_at) since created_at is never populated (modified_at is always set) - Remove dead is_tagging_job_cancelled function (superseded by is_tagging_job_processing) and unused thumbnail_path from ImagePathRecord indexer.rs: - Watcher create path now calls update_folder_count after commit_batch and emits folder-counts-changed so the sidebar count stays in sync; the notification is only emitted when the DB write actually succeeds store.ts / Timeline.tsx: - compareImages taken_asc/taken_desc: fall back to modified_at not created_at (created_at is always null) - Timeline groupImages: same fallback fix so images group by month correctly for libraries not yet re-indexed for EXIF - subscribeToProgress: listen for folder-counts-changed and call loadFolders() to keep the sidebar image count live
This commit is contained in:
@@ -22,7 +22,7 @@ function buildLabel(key: string): string {
|
||||
function groupImages(images: ImageRecord[]): TimelineGroup[] {
|
||||
const map = new Map<string, ImageRecord[]>();
|
||||
for (const img of images) {
|
||||
const ds = img.taken_at ?? img.created_at;
|
||||
const ds = img.taken_at ?? img.modified_at;
|
||||
const key = ds ? ds.substring(0, 7) : "unknown";
|
||||
let bucket = map.get(key);
|
||||
if (bucket === undefined) {
|
||||
|
||||
Reference in New Issue
Block a user