1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00
This commit is contained in:
Steffo 2019-03-01 18:11:01 +01:00
parent 82bcbce828
commit 0f3aa98d35

7
db.py
View file

@ -1342,8 +1342,11 @@ class Brawlhalla(Base, Mini):
self.rating = rating.value self.rating = rating.value
best_team_data = Dirty((self.best_team_partner_id, self.best_team_rating)) best_team_data = Dirty((self.best_team_partner_id, self.best_team_rating))
try: try:
current_best_team = max(j.get("2v2", []), key=lambda t: j.get("rating", 0)) current_best_team = max(j.get("2v2", []), key=lambda t: t.get("rating", 0))
self.best_team_partner_id = current_best_team["brawlhalla_id_two"] if current_best_team["brawlhalla_id_one"] == self.brawlhalla_id:
self.best_team_partner_id = current_best_team["brawlhalla_id_two"]
else:
self.best_team_partner_id = current_best_team["brawlhalla_id_one"]
self.best_team_rating = current_best_team["rating"] self.best_team_rating = current_best_team["rating"]
best_team_data.value = (self.best_team_partner_id, self.best_team_rating) best_team_data.value = (self.best_team_partner_id, self.best_team_rating)
except ValueError: except ValueError: