From b501960fed8811c41b94b69cb0610f243229588c Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 24 Mar 2019 11:54:21 +0100 Subject: [PATCH] Fix champion images with a name different from their id from loading (Leblanc != LeBlanc) --- db.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/db.py b/db.py index 8c54b181..d99ca514 100644 --- a/db.py +++ b/db.py @@ -571,11 +571,11 @@ class LeagueOfLegends(Base, Mini): def highest_mastery_champ_name(self): champ = loldata.get_champ_by_key(self.highest_mastery_champ) - return champ["name"] + return champ["id"] def highest_mastery_champ_image(self): champ = loldata.get_champ_by_key(self.highest_mastery_champ) - return loldata.get_champ_icon(champ["name"]) + return loldata.get_champ_icon(champ["id"]) class Osu(Base, Mini): @@ -1145,6 +1145,25 @@ class Terraria13(Base, Mini): return f"" +class Minecraft2019(Base, Mini): + __tablename__ = "minecraft2019" + + game_name = "Minecraft 2019" + + royal_id = Column(Integer, ForeignKey("royals.id"), primary_key=True) + royal = relationship("Royal", backref="minecraft2019", lazy="joined") + + character_name = Column(String) + contribution = Column(Integer) + + _mini_full_name = "Minecraft 2019" + _mini_name = "minecraft2019" + _mini_order = [contribution.desc()] + + def __repr__(self): + return f"" + + mini_list = [Royal, Telegram, Steam, Dota, LeagueOfLegends, Osu, Discord, Overwatch, Halloween, Terraria13]