Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
harry committed Apr 15, 2024
1 parent 1e96357 commit d4eb7bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/controllers/v1/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def delete_video(request: Request, task_id: str = Path(..., description="Task ID

sm.state.delete_task(task_id)
logger.success(f"video deleted: {utils.to_json(task)}")
return utils.get_response(200, task)
return utils.get_response(200)

raise HttpException(task_id=task_id, status_code=404, message=f"{request_id}: task not found")

Expand Down Expand Up @@ -190,4 +190,5 @@ async def download_video(_: Request, file_path: str):
headers = {
"Content-Disposition": f"attachment; filename={filename}{extension}"
}
return FileResponse(path=video_path, headers=headers, filename=f"{filename}{extension}", media_type=f'video/{extension[1:]}')
return FileResponse(path=video_path, headers=headers, filename=f"{filename}{extension}",
media_type=f'video/{extension[1:]}')

0 comments on commit d4eb7bc

Please sign in to comment.