Fix seeding infos

master
Lertsenem 2021-07-26 09:51:28 +02:00
parent 21cb648422
commit c5e2e062b8
2 changed files with 10 additions and 1 deletions

View File

@ -874,10 +874,16 @@ def getTournamentTop(
for standing in standings :
seeding = None
seeding32 = None
for seed in standing["entrant"]["seeds"]:
# Take the seeding from the phase with *all* Event entrants
if seed["phase"]["numSeeds"] == tournament.numEntrants:
seeding = seed["groupSeedNum"]
if seed["phase"]["numSeeds"] == 32:
seeding32 = seed["groupSeedNum"]
if seeding is None:
log.info("no global seeding found, using top 32 seeding")
seeding = seeding32
participant_data = standing["entrant"]["participants"][0]

View File

@ -46,7 +46,10 @@ class Player():
self.prefix = ( "" if prefix is None else prefix )
self.gamerTag = gamerTag
self.placement = int(placement)
self.seeding = int(seeding)
try:
self.seeding = int(seeding)
except:
self.seeding = 0
self.twitterHandle = ( "" if twitterHandle is None else twitterHandle )
try: