set only one tournament to increment league day

This commit is contained in:
Sakimori 2021-01-15 05:09:23 -05:00
parent fc07efa7ef
commit 016bc2ed24
2 changed files with 5 additions and 1 deletions

View File

@ -322,6 +322,7 @@ class league_structure(object):
subleague_tournament.league = self subleague_tournament.league = self
tournaments.append(subleague_tournament) tournaments.append(subleague_tournament)
tournaments[0].increment = True
return tournaments return tournaments
@ -341,6 +342,7 @@ class tournament(object):
self.id = id self.id = id
self.league = None self.league = None
self.winner = None self.winner = None
self.increment = False
if id is None: if id is None:
self.id = random.randint(1111,9999) self.id = random.randint(1111,9999)

View File

@ -1292,7 +1292,7 @@ async def tourney_round_watcher(channel, tourney, games_list, filter_url, finals
except: except:
print("something went wrong in tourney_watcher") print("something went wrong in tourney_watcher")
await asyncio.sleep(4) await asyncio.sleep(4)
if tourney.league is not None: if tourney.league is not None and tourney.league.increment:
tourney.league.day += 1 tourney.league.day += 1
if len(queued_games) > 0: if len(queued_games) > 0:
@ -1851,6 +1851,7 @@ async def league_postseason(channel, league):
tiebreakers = league.tiebreaker_required() tiebreakers = league.tiebreaker_required()
if tiebreakers != []: if tiebreakers != []:
await channel.send("Tiebreakers required!") await channel.send("Tiebreakers required!")
tiebreakers[0].increment = True
await asyncio.gather(*[start_tournament_round(channel, tourney) for tourney in tiebreakers]) await asyncio.gather(*[start_tournament_round(channel, tourney) for tourney in tiebreakers])
for tourney in tiebreakers: for tourney in tiebreakers:
league.update_standings({tourney.winner.name : {"wins" : 1}}) league.update_standings({tourney.winner.name : {"wins" : 1}})
@ -1880,6 +1881,7 @@ async def league_postseason(channel, league):
tourneys = league.champ_series() tourneys = league.champ_series()
tourneys[0].increment = true
await asyncio.gather(*[start_tournament_round(channel, tourney) for tourney in tourneys]) await asyncio.gather(*[start_tournament_round(channel, tourney) for tourney in tourneys])
champs = {} champs = {}
for tourney in tourneys: for tourney in tourneys: