Resoted avatars.

This commit is contained in:
retoor 2025-05-25 18:51:55 +02:00
parent ffc373db62
commit 5e4c4ce228

View File

@ -41,6 +41,15 @@ class AvatarView(BaseView):
self.avatars = {}
async def get(self):
type_ = self.request.match_info.get("type")
type_match = {
"animal": self.get_animal,
"default": self.get_default
}
handler = type_match.get(type_, self.get_default)
return await handler()
async def get_animal(self):
uid = self.request.match_info.get("uid")
while True:
try:
@ -57,7 +66,7 @@ class AvatarView(BaseView):
self.avatars[uid] = avatar
return avatar
async def get2(self):
async def get_default(self):
uid = self.request.match_info.get("uid")
if uid == "unique":
uid = str(uuid.uuid4())