Update main.py
Browse files
main.py
CHANGED
|
@@ -161,6 +161,21 @@ async def update():
|
|
| 161 |
status_code=500
|
| 162 |
)
|
| 163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
# Helper function to upload the image to Cloudinary
|
| 165 |
def upload_image(data, character_id, player_id):
|
| 166 |
try:
|
|
|
|
| 161 |
status_code=500
|
| 162 |
)
|
| 163 |
|
| 164 |
+
@app.get("/updatezzz")
|
| 165 |
+
async def maiin():
|
| 166 |
+
try:
|
| 167 |
+
async with zenka.Client() as client:
|
| 168 |
+
await client.update_asset()
|
| 169 |
+
|
| 170 |
+
await asyncio.create_task(maiin())
|
| 171 |
+
return JSONResponse(content={'response': 'Assets updated successfully'})
|
| 172 |
+
except ZZZError as e:
|
| 173 |
+
error_details = traceback.format_exc()
|
| 174 |
+
return JSONResponse(
|
| 175 |
+
content={'error': f'UNKNOWN ERR: {str(e)}', 'details': error_details},
|
| 176 |
+
status_code=500
|
| 177 |
+
)
|
| 178 |
+
|
| 179 |
# Helper function to upload the image to Cloudinary
|
| 180 |
def upload_image(data, character_id, player_id):
|
| 181 |
try:
|