title modification

This commit is contained in:
2026-09-26 08:03:20 +08:00
parent 37ee850ee1
commit 7fae2bb8c9
6 changed files with 106 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ from .models import (
AuthRequest,
AuthResponse,
CourseSummary,
CourseTitleUpdate,
SentenceBoundaryAdjust,
SentenceBoundary,
SentenceBoundaryDocument,
@@ -624,6 +625,20 @@ def create_app(
background_tasks.add_task(_process_safely, processor, video_hash)
return {"video_hash": video_hash.lower(), "status": "processing_queued"}
@application.put(
"/api/v1/admin/videos/{video_hash}/title",
response_model=VideoSummary,
dependencies=[Depends(require_admin)],
)
def update_course_title(
payload: CourseTitleUpdate,
video_hash: str = SHA256_PATH,
) -> VideoSummary:
video = video_repository.update_title(video_hash, payload.title)
if video is None:
raise HTTPException(status_code=404, detail="Video was not found.")
return _video_summary(video, service_settings)
@application.put(
"/api/v1/admin/videos/{video_hash}/sentences/{sentence_index}",
response_model=SentenceBoundary,