diff --git a/files.py b/files.py index 27144c8..6be56f8 100644 --- a/files.py +++ b/files.py @@ -519,40 +519,37 @@ def view_img(id): face.locn = json.loads(face.locn) return render_template("viewer.html", current=int(id), eids=eids, objs=objs, OPT=OPT ) -# route called from front/end - if multiple images are being rotated, each rotation == a separate call -# to this route (and therefore a separate rotate job. Each reponse allows the f/e to check the -# specific rotation job is finished (/checkrotatejob) which will be called (say) every 1 sec. from f/e -# with a spinning wheel, then when pa_job_mgr has finished it will return the rotated thumb -@app.route("/rotate", methods=["POST"]) +# route called from front/end - if multiple images are being transformed, each transorm == a separate call +# to this route (and therefore a separate transorm job. Each reponse allows the f/e to check the +# specific transorm job is finished (/checktransformjob) which will be called (say) every 1 sec. from f/e +# with a spinning wheel, then when pa_job_mgr has finished it will return the transformed thumb @app.route("/transform", methods=["POST"]) @login_required -def rotate(): +def transform(): id = request.form['id'] amt = request.form['amt'] - print( f"rotate called with id={id}, amt={amt}") + print( f"transform called with id={id}, amt={amt}") jex=[] for el in request.form: jex.append( JobExtra( name=f"{el}", value=request.form[el] ) ) - job=NewJob( "rotate_image", 0, None, jex ) + job=NewJob( "transform_image", 0, None, jex ) resp={} resp['job_id']=job.id - # TODO: make this return data with the job number, then the f/e can poll checkrotatejob return resp ################################################################################ -# /checkrotatejob -> URL that is called repeatedly by front-end waiting for the -# b/e to finish the rotate job. Once done, the new / now -# rotated image's thumbnail is returned so the f/e can +# /checktransformjob -> URL that is called repeatedly by front-end waiting for the +# b/e to finish the transform job. Once done, the new / now +# transformed image's thumbnail is returned so the f/e can # update with it ################################################################################ @app.route("/checktransformjob", methods=["POST"]) -@app.route("/checkrotatejob", methods=["POST"]) @login_required -def checkrotatejob(): +def checktransformjob(): job_id = request.form['job_id'] job = Job.query.get(job_id) resp={}