fix: handle players removed from team
This commit is contained in:
parent
b9efd4f7a3
commit
8c8a88e72c
@ -146,6 +146,8 @@ def graph_json(
|
||||
for c in session.exec(statement2):
|
||||
user = player_map[c.user]
|
||||
for i, p_id in enumerate(c.love):
|
||||
if p_id not in player_map:
|
||||
continue
|
||||
p = player_map[p_id]
|
||||
edges.append(
|
||||
{
|
||||
@ -161,6 +163,8 @@ def graph_json(
|
||||
}
|
||||
)
|
||||
for p_id in c.hate:
|
||||
if p_id not in player_map:
|
||||
continue
|
||||
p = player_map[p_id]
|
||||
edges.append(
|
||||
{
|
||||
@ -335,6 +339,8 @@ def mvp(
|
||||
)
|
||||
for r in session.exec(statement2):
|
||||
for i, p_id in enumerate(r.mvps):
|
||||
if p_id not in player_map:
|
||||
continue
|
||||
p = player_map[p_id]
|
||||
ranks[p] = ranks.get(p, []) + [i + 1]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user