Mbonea commited on
Commit
055fbf7
1 Parent(s): 3aef757

minor changes

Browse files
Files changed (2) hide show
  1. App/Editor/editorRoutes.py +1 -1
  2. App/Worker.py +2 -5
App/Editor/editorRoutes.py CHANGED
@@ -8,7 +8,7 @@ videditor_router = APIRouter(tags=["vidEditor"])
8
 
9
  @videditor_router.post("/create-video")
10
  async def create_video(videoRequest: EditorRequest):
11
- result = celery_task.delay(videoRequest.dict())
12
  return {"task_id": result.task_id}
13
 
14
 
 
8
 
9
  @videditor_router.post("/create-video")
10
  async def create_video(videoRequest: EditorRequest):
11
+ result = celery_task.delay(**videoRequest.dict())
12
  return {"task_id": result.task_id}
13
 
14
 
App/Worker.py CHANGED
@@ -65,8 +65,7 @@ def cleanup_temp_directory(
65
 
66
 
67
  @celery.task
68
- def celery_task(video_request):
69
- video_request = EditorRequest.parse_obj(video_request)
70
  remotion_app_dir = os.path.join("/srv", "Remotion-app")
71
  project_id = str(uuid.uuid4())
72
  temp_dir = f"/tmp/{project_id}"
@@ -75,9 +74,7 @@ def celery_task(video_request):
75
  chain(
76
  copy_remotion_app.s(remotion_app_dir, temp_dir),
77
  install_dependencies.s(temp_dir),
78
- download_assets.s(video_request.links, temp_dir)
79
- if video_request.links
80
- else None,
81
  render_video.s(temp_dir, output_dir),
82
  cleanup_temp_directory.s(temp_dir, output_dir),
83
  ).apply_async(
 
65
 
66
 
67
  @celery.task
68
+ def celery_task(links, script=""):
 
69
  remotion_app_dir = os.path.join("/srv", "Remotion-app")
70
  project_id = str(uuid.uuid4())
71
  temp_dir = f"/tmp/{project_id}"
 
74
  chain(
75
  copy_remotion_app.s(remotion_app_dir, temp_dir),
76
  install_dependencies.s(temp_dir),
77
+ download_assets.s(links, temp_dir) if links else None,
 
 
78
  render_video.s(temp_dir, output_dir),
79
  cleanup_temp_directory.s(temp_dir, output_dir),
80
  ).apply_async(