Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
delete getState support several method
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoXinYo committed Sep 21, 2023
1 parent f15f0e4 commit 8f82b22
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def error500(error: Exception) -> Response:
def submit() -> Response:
target = request.files.get('target')
source = request.files.get('source')
parameter = core.getRequestParameter(request)
parameter = request.form
modes = request.form.getlist('modes')
keepFPS = parameter.get('keepFPS', False)
skipAudio = parameter.get('skipAudio', False)
Expand Down Expand Up @@ -59,7 +59,7 @@ def submit() -> Response:
})
return core.GenerateResponse().success(token)

@APP.post('/delete')
@APP.route('/delete', methods=['GET', 'POST'])
def delete() -> Response:
token = core.getRequestParameter(request).get('token')
if not token:
Expand All @@ -77,8 +77,8 @@ def delete() -> Response:
redis.deleteTask(token)
return core.GenerateResponse().success('success')

@APP.get('/get_state')
def get_state() -> Response:
@APP.route('/get_state', methods=['GET', 'POST'])
def getState() -> Response:
token = core.getRequestParameter(request).get('token')
if not token:
return core.GenerateResponse().error(110, 'parameter cannot be empty')
Expand All @@ -90,7 +90,7 @@ def get_state() -> Response:

@APP.get('/download')
def download() -> Response:
token = core.getRequestParameter(request).get('token')
token = request.get_json().get('token')
if not token:
return core.GenerateResponse().error(110, 'parameter cannot be empty')

Expand Down

0 comments on commit 8f82b22

Please sign in to comment.