repaire sentences
This commit is contained in:
@@ -116,6 +116,23 @@ class SubtitleTranslationService:
|
||||
except (KeyError, ValueError, AITutorError):
|
||||
logger.exception("Could not restart subtitle translation: video=%s", video_hash)
|
||||
|
||||
def start_missing(self, video_hash: str) -> None:
|
||||
"""Translate sentences that still lack Chinese text, keeping existing ones."""
|
||||
if not getattr(self.ai_tutor, "available", False):
|
||||
return
|
||||
document = self.repository.get_document(video_hash)
|
||||
if document is None:
|
||||
return
|
||||
if self.snapshot(document).complete:
|
||||
return
|
||||
try:
|
||||
self._start_if_needed(video_hash)
|
||||
except (KeyError, ValueError, AITutorError):
|
||||
logger.exception(
|
||||
"Could not start subtitle translation after gap repair: video=%s",
|
||||
video_hash,
|
||||
)
|
||||
|
||||
def admin_snapshot(self, video_hash: str) -> AdminSubtitleTranslationResponse | None:
|
||||
current = self.current(video_hash)
|
||||
if current is None:
|
||||
|
||||
Reference in New Issue
Block a user