Дублирующий пересчёт очков в fetch_tournament для надёжности
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 5s
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 5s
This commit is contained in:
parent
98a8febf37
commit
bc6e57b91d
1 changed files with 3 additions and 1 deletions
|
|
@ -460,13 +460,15 @@ def fetch_tournament(url: str) -> dict:
|
||||||
if res_copy.get('opponent') and res_copy['opponent'] > 0:
|
if res_copy.get('opponent') and res_copy['opponent'] > 0:
|
||||||
opp_sno = res_copy['opponent']
|
opp_sno = res_copy['opponent']
|
||||||
if opp_sno not in sno_to_standing:
|
if opp_sno not in sno_to_standing:
|
||||||
# Try to normalise opponent SNo via name from standings
|
|
||||||
for s2 in standings:
|
for s2 in standings:
|
||||||
if s2['rank'] == opp_sno and s2.get('starting_sno'):
|
if s2['rank'] == opp_sno and s2.get('starting_sno'):
|
||||||
res_copy['opponent'] = s2['starting_sno']
|
res_copy['opponent'] = s2['starting_sno']
|
||||||
break
|
break
|
||||||
s['results'].append(res_copy)
|
s['results'].append(res_copy)
|
||||||
|
|
||||||
|
for s in standings:
|
||||||
|
s['points'] = sum(r.get('score', 0) for r in s.get('results', []))
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'name': meta['name'],
|
'name': meta['name'],
|
||||||
'num_rounds': meta['num_rounds'],
|
'num_rounds': meta['num_rounds'],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue