File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -186,8 +186,9 @@ def enabled_handler(enabled: bool, request: Request):
186
186
raise HTTPException (status_code = status .HTTP_401_UNAUTHORIZED )
187
187
print (f"enabled={ enabled } " )
188
188
try :
189
+ r = ""
189
190
if enabled :
190
- ocs_call (
191
+ result = ocs_call (
191
192
"POST" ,
192
193
"/ocs/v1.php/apps/app_api/api/v1/files/actions/menu" ,
193
194
json_data = {
@@ -200,15 +201,19 @@ def enabled_handler(enabled: bool, request: Request):
200
201
}
201
202
},
202
203
)
204
+ response_data = json .loads (result .text )
205
+ ocs_meta = response_data ["ocs" ]["meta" ]
206
+ if ocs_meta ["status" ] != "ok" :
207
+ r = f"error: { ocs_meta ['message' ]} "
203
208
else :
204
209
ocs_call (
205
210
"DELETE" ,
206
211
"/ocs/v1.php/apps/app_api/api/v1/files/actions/menu" ,
207
212
json_data = {"fileActionMenuName" : "upscale" },
208
213
)
209
- r = ""
210
214
except Exception as e :
211
215
r = str (e )
216
+ print (f"enabled={ enabled } -> { r } " )
212
217
return responses .JSONResponse (content = {"error" : r }, status_code = 200 )
213
218
214
219
You can’t perform that action at this time.
0 commit comments