fix: preserve upload recovery and harden speech indexing

This commit is contained in:
2026-08-12 19:49:25 +08:00
parent 10f2c078ec
commit a0a185b96c
16 changed files with 13234 additions and 62 deletions
+6
View File
@@ -779,6 +779,10 @@ class Database:
conn.execute("ALTER TABLE uploads ADD COLUMN IF NOT EXISTS external_local_path TEXT")
conn.execute("ALTER TABLE uploads ADD COLUMN IF NOT EXISTS external_size_bytes BIGINT")
conn.execute("ALTER TABLE uploads ADD COLUMN IF NOT EXISTS external_attempts INTEGER NOT NULL DEFAULT 0")
conn.execute(
"ALTER TABLE uploads ADD COLUMN IF NOT EXISTS recovery_state TEXT NOT NULL DEFAULT 'receiving'"
)
conn.execute("ALTER TABLE uploads ADD COLUMN IF NOT EXISTS recovery_mode TEXT")
conn.execute(
"UPDATE videos v SET storage_backend=u.storage_backend,physical_path=u.external_target_path,"
"physical_size_bytes=coalesce(u.external_size_bytes,v.size_bytes) FROM ("
@@ -1291,6 +1295,8 @@ CREATE TABLE IF NOT EXISTS uploads (
external_local_path TEXT,
external_size_bytes BIGINT,
external_attempts INTEGER NOT NULL DEFAULT 0,
recovery_state TEXT NOT NULL DEFAULT 'receiving',
recovery_mode TEXT,
created_at TEXT NOT NULL,
updated_at TEXT NOT NULL,
expires_at TEXT NOT NULL