Update main.py
Browse files
main.py
CHANGED
|
@@ -142,16 +142,12 @@ def root():
|
|
| 142 |
def root():
|
| 143 |
return "خدتك عليه"
|
| 144 |
|
| 145 |
-
async def update_assets() -> None:
|
| 146 |
-
async with EnkaNetworkAPI() as client:
|
| 147 |
-
await client.update_assets()
|
| 148 |
-
await enka.ApiEnkaNetwork().update_assets()
|
| 149 |
-
|
| 150 |
@app.get("/update")
|
| 151 |
async def root():
|
| 152 |
try:
|
| 153 |
-
|
| 154 |
-
|
|
|
|
| 155 |
except Exception as e:
|
| 156 |
return JSONResponse(content={'error': 'UNKNOWN ERR: ' + str(e)}, status_code=500)
|
| 157 |
|
|
|
|
| 142 |
def root():
|
| 143 |
return "خدتك عليه"
|
| 144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
@app.get("/update")
|
| 146 |
async def root():
|
| 147 |
try:
|
| 148 |
+
# Update assets using encbanner
|
| 149 |
+
result = await encbanner.update() # Await the async update method
|
| 150 |
+
return JSONResponse(content={'response': 'Assets updated successfully', 'result': result})
|
| 151 |
except Exception as e:
|
| 152 |
return JSONResponse(content={'error': 'UNKNOWN ERR: ' + str(e)}, status_code=500)
|
| 153 |
|