1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Fix champion images with a name different from their id from loading (Leblanc != LeBlanc)

This commit is contained in:
Steffo 2019-03-24 11:54:21 +01:00
parent 39dcb6e112
commit b501960fed

23
db.py
View file

@ -571,11 +571,11 @@ class LeagueOfLegends(Base, Mini):
def highest_mastery_champ_name(self): def highest_mastery_champ_name(self):
champ = loldata.get_champ_by_key(self.highest_mastery_champ) champ = loldata.get_champ_by_key(self.highest_mastery_champ)
return champ["name"] return champ["id"]
def highest_mastery_champ_image(self): def highest_mastery_champ_image(self):
champ = loldata.get_champ_by_key(self.highest_mastery_champ) 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): class Osu(Base, Mini):
@ -1145,6 +1145,25 @@ class Terraria13(Base, Mini):
return f"<Terraria13 {self.character_name} {self.contribution}>" return f"<Terraria13 {self.character_name} {self.contribution}>"
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"<Terraria13 {self.character_name} {self.contribution}>"
mini_list = [Royal, Telegram, Steam, Dota, LeagueOfLegends, Osu, Discord, Overwatch, Halloween, mini_list = [Royal, Telegram, Steam, Dota, LeagueOfLegends, Osu, Discord, Overwatch, Halloween,
Terraria13] Terraria13]