fix a bug

This commit is contained in:
2026-10-29 13:25:39 +08:00
parent a87228cdc9
commit d143eb7fed
3 changed files with 56 additions and 8 deletions

View File

@@ -389,13 +389,11 @@ async function handleSentenceDialogClose() {
if (state.sentencePending) {
const persisted = await saveSentenceDraft({ processTimings: false });
if (!persisted) {
if (state.sentenceVideo && !elements.dialog.open) elements.dialog.showModal();
return;
}
}
const processed = await saveSentenceDraft({ processTimings: true });
if (!processed) {
if (state.sentenceVideo && !elements.dialog.open) elements.dialog.showModal();
return;
}
resetSentenceDraft();
@@ -417,8 +415,17 @@ async function saveSentenceDraft({ processTimings = false } = {}) {
index,
originStartMs,
originEndMs,
sourceStartMs,
sourceEndMs,
...sentence
}) => sentence),
}) => ({
...sentence,
...(sourceStartMs !== undefined && sourceEndMs !== undefined ? {
source_start_ms: sourceStartMs,
source_end_ms: sourceEndMs,
} : {}),
}),
),
};
const saved = await api(
`/api/v1/admin/videos/${video.video_hash}/sentences/batch`,