feat: AI photo enhancement (Real-ESRGAN container) + restore original

- new photo-ai service: FastAPI + Real-ESRGAN x2plus on CPU, internal only
- async job queue in server (POST enhance-ai / GET status), 5min timeout, sequential processing
- keep original photo backup (entries.photo_original_path, uploads/.originals), restore-original endpoint
- UI: AI button and restore-original button in enhance modal
- db: photo_original_path column (init.sql, migration.sql, runtime ensure)
This commit is contained in:
dev
2026-09-17 15:37:49 +03:00
parent c4fd31cd53
commit 3a345cbefd
9 changed files with 333 additions and 5 deletions
+1
View File
@@ -42,6 +42,7 @@ CREATE TABLE IF NOT EXISTS entries (
ai_checked_at TIMESTAMPTZ,
ai_error TEXT,
photo_path VARCHAR(255),
photo_original_path VARCHAR(255),
deleted_at TIMESTAMPTZ,
created_at TIMESTAMPTZ DEFAULT now()
);
+2
View File
@@ -199,3 +199,5 @@ $$ LANGUAGE plpgsql;
DROP TRIGGER IF EXISTS trg_entries_notify ON entries;
CREATE TRIGGER trg_entries_notify AFTER INSERT OR UPDATE OF ai_status ON entries
FOR EACH ROW EXECUTE FUNCTION notify_entries_changed();
ALTER TABLE entries ADD COLUMN IF NOT EXISTS photo_original_path VARCHAR(255);