fff
This commit is contained in:
@@ -753,6 +753,23 @@ def create_app(
|
||||
except AITutorError as exc:
|
||||
raise HTTPException(status_code=503, detail=str(exc)) from exc
|
||||
|
||||
@application.post(
|
||||
"/api/v1/admin/videos/{video_hash}/subtitle-translation/repair",
|
||||
response_model=AdminSubtitleTranslationResponse,
|
||||
dependencies=[Depends(require_admin)],
|
||||
)
|
||||
def repair_subtitle_translation(
|
||||
video_hash: str = SHA256_PATH,
|
||||
) -> AdminSubtitleTranslationResponse:
|
||||
try:
|
||||
return application.state.subtitle_translations.repair_missing(video_hash)
|
||||
except KeyError:
|
||||
raise HTTPException(status_code=404, detail="Course is not available.") from None
|
||||
except ValueError as exc:
|
||||
raise HTTPException(status_code=422, detail=str(exc)) from exc
|
||||
except AITutorError as exc:
|
||||
raise HTTPException(status_code=503, detail=str(exc)) from exc
|
||||
|
||||
@application.put(
|
||||
"/api/v1/admin/videos/{video_hash}/title",
|
||||
response_model=VideoSummary,
|
||||
|
||||
Reference in New Issue
Block a user