|
|
@@ -15,6 +15,7 @@ d=db()
|
|
|
def index():
|
|
|
return "Hello world"
|
|
|
|
|
|
+@app.route(BASE_PATH + '/list/raw/')
|
|
|
@app.route(BASE_PATH + '/list/raw')
|
|
|
def raw_list():
|
|
|
ret={'list': d.raw() }
|
|
|
@@ -27,11 +28,12 @@ def raw_file(video_id):
|
|
|
return jsonify(ret)
|
|
|
|
|
|
@app.route(BASE_PATH + '/list/processed/')
|
|
|
+@app.route(BASE_PATH + '/list/processed')
|
|
|
def processed_list():
|
|
|
ret={'list': d.processed() }
|
|
|
return jsonify(ret)
|
|
|
-@app.route(BASE_PATH + '/cut/', methods=["POST"])
|
|
|
-def cut():
|
|
|
+@app.route(BASE_PATH + '/crop/', methods=["POST"])
|
|
|
+def crop():
|
|
|
ret={"status":"Procesando"}
|
|
|
today=datetime.date.today()
|
|
|
data = request.get_json()
|
|
|
@@ -41,14 +43,20 @@ def cut():
|
|
|
today.strftime('%Y%m%d'),
|
|
|
data["desc"])
|
|
|
|
|
|
- job = tasks.cut_video.delay(video["file"],
|
|
|
- str(data["inicio"]),
|
|
|
- str(data["fin"]),
|
|
|
- out_filename)
|
|
|
+ job = tasks.jobrunner(tasks.crop_video,
|
|
|
+ (video["file"],
|
|
|
+ str(data["inicio"]),
|
|
|
+ str(data["fin"]),
|
|
|
+ out_filename,))
|
|
|
+ #job = tasks.crop_video.delay(video["file"],
|
|
|
+ # str(data["inicio"]),
|
|
|
+ # str(data["fin"]),
|
|
|
+ # out_filename)
|
|
|
ret["job_id"]=job.get_id()
|
|
|
return jsonify(ret)
|
|
|
|
|
|
-@app.route(BASE_PATH + '/jobs/')
|
|
|
+@app.route(BASE_PATH + '/list/jobs/')
|
|
|
+@app.route(BASE_PATH + '/list/jobs')
|
|
|
def jobs():
|
|
|
working = tasks.jobs()
|
|
|
finished = d.getJobs()
|