title modification
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user