fixed bugs
This commit is contained in:
@@ -602,17 +602,14 @@ class VideoRepository:
|
||||
with self._connect() as connection:
|
||||
cursor = connection.execute(
|
||||
"""
|
||||
UPDATE sentences SET text = ?, language = COALESCE(?, language)
|
||||
UPDATE sentences SET text = ?, language = COALESCE(?, language),
|
||||
zh_text = NULL
|
||||
WHERE video_hash = ? AND sentence_index = ?
|
||||
""",
|
||||
(text.strip(), language, normalized_hash, sentence_index),
|
||||
)
|
||||
if cursor.rowcount == 0:
|
||||
return None
|
||||
connection.execute(
|
||||
"UPDATE sentences SET zh_text = NULL WHERE video_hash = ?",
|
||||
(normalized_hash,),
|
||||
)
|
||||
connection.execute(
|
||||
"UPDATE videos SET updated_at = ? WHERE video_hash = ?",
|
||||
(utc_now(), normalized_hash),
|
||||
@@ -817,7 +814,7 @@ class VideoRepository:
|
||||
"""
|
||||
UPDATE sentences
|
||||
SET end_ms = ?, text = ?, language = ?,
|
||||
reference_speech_duration_ms = ?
|
||||
reference_speech_duration_ms = ?, zh_text = NULL
|
||||
WHERE video_hash = ? AND sentence_index = ?
|
||||
""",
|
||||
(
|
||||
@@ -858,10 +855,6 @@ class VideoRepository:
|
||||
(old_index - 1, normalized_hash, old_index),
|
||||
)
|
||||
|
||||
connection.execute(
|
||||
"UPDATE sentences SET zh_text = NULL WHERE video_hash = ?",
|
||||
(normalized_hash,),
|
||||
)
|
||||
connection.execute(
|
||||
"UPDATE videos SET updated_at = ? WHERE video_hash = ?",
|
||||
(utc_now(), normalized_hash),
|
||||
|
||||
Reference in New Issue
Block a user