From 88db0c1b24a6e108f78ffe9ce8fc33a8f6f48e28 Mon Sep 17 00:00:00 2001 From: Nick Roodenrijs Date: Sun, 8 Mar 2026 19:44:27 +0100 Subject: [PATCH] Fix SQLite threading bug, correct FTP upload path - Add check_same_thread=False to SQLite connection (watchdog callbacks run in a separate thread) - Camera upload dir is /data/photos/incoming (not /incoming) Co-Authored-By: Claude Opus 4.6 --- README.md | 2 +- TODO.md | 2 +- processor.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e94ea95..00121c6 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Configure an FTP profile on the camera: | Passive Mode | **ON** | | Username | `fujiftp` | | Password | *(your password)* | -| Upload Dir | `/incoming` | +| Upload Dir | `/data/photos/incoming` | | Auto Transfer | ON (or manual trigger) | > **Note**: Bij FTPS kun je via **FTP OPTIONAL SETTING → ROOT CERTIFICATE** een self-signed root certificaat laden als je NAS er een gebruikt. diff --git a/TODO.md b/TODO.md index e8b52bd..543d889 100644 --- a/TODO.md +++ b/TODO.md @@ -52,7 +52,7 @@ - [ ] Passive mode: ON - [ ] Username: `fujiftp` - [ ] Password: (het ingestelde wachtwoord) - - [ ] Upload directory: `/incoming` + - [ ] Upload directory: `/data/photos/incoming` - [ ] Optioneel: FTP OPTIONAL SETTING → ROOT CERTIFICATE (als NAS self-signed cert gebruikt) - [ ] Profiel naam: "NAS-FTPS" - [ ] Opslaan diff --git a/processor.py b/processor.py index 3cbe722..51e1907 100644 --- a/processor.py +++ b/processor.py @@ -50,7 +50,7 @@ log = logging.getLogger("processor") def init_db(): """Initialize the SQLite tracking database.""" DB_PATH.parent.mkdir(parents=True, exist_ok=True) - conn = sqlite3.connect(str(DB_PATH)) + conn = sqlite3.connect(str(DB_PATH), check_same_thread=False) conn.execute( """CREATE TABLE IF NOT EXISTS processed_files ( filename TEXT PRIMARY KEY,