fixed a bug

This commit is contained in:
2026-09-12 21:27:51 +08:00
parent 55d6860cc0
commit 5856832eca
5 changed files with 247 additions and 17 deletions

View File

@@ -244,7 +244,24 @@ class VideoRepository:
)
def mark_processing(self, video_hash: str) -> None:
self._update_status(video_hash, "processing", None)
normalized_hash = normalize_video_hash(video_hash)
with self._connect() as connection:
connection.execute(
"DELETE FROM sentences WHERE video_hash = ?",
(normalized_hash,),
)
connection.execute(
"DELETE FROM moss_segments WHERE video_hash = ?",
(normalized_hash,),
)
connection.execute(
"""
UPDATE videos
SET status = ?, error_message = NULL, transcription = NULL, updated_at = ?
WHERE video_hash = ?
""",
("processing", utc_now(), normalized_hash),
)
def mark_failed(self, video_hash: str, message: str) -> None:
self._update_status(video_hash, "failed", message[:4000])