1
0

fix: can't use all achievements

This commit is contained in:
オスカー、 2023-03-22 13:55:33 +00:00 committed by GitHub
parent e517db7d63
commit 60ce37f101
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
app.py
View File

@ -121,9 +121,9 @@ async def update_metadata(response: Response, code: str, steam_id: str = Cookie(
async for achieve in async_list(data["achievements"]):
if achieve["achieved"] == 1:
success += 1
role.add_or_edit_metadata(key=achieve["apiname"], value=True if achieve["achieved"] == 1 else False)
percentage = (success / total) * 100
role.add_or_edit_metadata(key="percentage", value=percentage)
role.add_or_edit_metadata(key="completed", value=False)
if percentage == 100:
role.add_or_edit_metadata(key="completed", value=True)
await user.edit_role_connection(role)