From 11b6e447ae57aa4ff2bd82f1d6bfbd905b83a1fb Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sun, 4 Mar 2018 08:18:21 +0000 Subject: [PATCH] Bugfix usercard animations not showing --- webapp/titanembeds/blueprints/api/api.py | 4 ++-- webapp/titanembeds/oauth.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/webapp/titanembeds/blueprints/api/api.py b/webapp/titanembeds/blueprints/api/api.py index 1cee11a..6133704 100644 --- a/webapp/titanembeds/blueprints/api/api.py +++ b/webapp/titanembeds/blueprints/api/api.py @@ -140,7 +140,7 @@ def get_online_embed_users(guild_id): 'username': usrdb.username, 'nickname': usrdb.nickname, 'discriminator': usrdb.discriminator, - 'avatar_url': generate_avatar_url(usrdb.user_id, usrdb.avatar, "0000", True), + 'avatar_url': generate_avatar_url(usrdb.user_id, usrdb.avatar), } users['authenticated'].append(meta) return users @@ -469,7 +469,7 @@ def user_info(guild_id, user_id): usr["nickname"] = member.nickname usr["discriminator"] = member.discriminator usr["avatar"] = member.avatar - usr["avatar_url"] = generate_avatar_url(usr["id"], usr["avatar"], usr["discriminator"]) + usr["avatar_url"] = generate_avatar_url(usr["id"], usr["avatar"], usr["discriminator"], True) roles = get_member_roles(guild_id, user_id) dbguild = db.session.query(Guilds).filter(Guilds.guild_id == guild_id).first() guild_roles = json.loads(dbguild.roles) diff --git a/webapp/titanembeds/oauth.py b/webapp/titanembeds/oauth.py index 511781a..91c66cd 100644 --- a/webapp/titanembeds/oauth.py +++ b/webapp/titanembeds/oauth.py @@ -97,6 +97,8 @@ def check_user_permission(guild_id, id): def generate_avatar_url(id, av, discrim="0000", allow_animate=False): if av: + print(allow_animate) + print(str(av).startswith("a_")) if allow_animate and str(av).startswith("a_"): return avatar_base_url + str(id) + '/' + str(av) + '.gif' return avatar_base_url + str(id) + '/' + str(av) + '.png'