From 016bc2ed24f701b424c1b3773fb94c3856b417f8 Mon Sep 17 00:00:00 2001 From: Sakimori Date: Fri, 15 Jan 2021 05:09:23 -0500 Subject: [PATCH] set only one tournament to increment league day --- leagues.py | 2 ++ the_prestige.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/leagues.py b/leagues.py index 20d38f2..298b8ab 100644 --- a/leagues.py +++ b/leagues.py @@ -322,6 +322,7 @@ class league_structure(object): subleague_tournament.league = self tournaments.append(subleague_tournament) + tournaments[0].increment = True return tournaments @@ -341,6 +342,7 @@ class tournament(object): self.id = id self.league = None self.winner = None + self.increment = False if id is None: self.id = random.randint(1111,9999) diff --git a/the_prestige.py b/the_prestige.py index b6967b2..10a3b67 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -1292,7 +1292,7 @@ async def tourney_round_watcher(channel, tourney, games_list, filter_url, finals except: print("something went wrong in tourney_watcher") await asyncio.sleep(4) - if tourney.league is not None: + if tourney.league is not None and tourney.league.increment: tourney.league.day += 1 if len(queued_games) > 0: @@ -1851,6 +1851,7 @@ async def league_postseason(channel, league): tiebreakers = league.tiebreaker_required() if tiebreakers != []: await channel.send("Tiebreakers required!") + tiebreakers[0].increment = True await asyncio.gather(*[start_tournament_round(channel, tourney) for tourney in tiebreakers]) for tourney in tiebreakers: league.update_standings({tourney.winner.name : {"wins" : 1}}) @@ -1880,6 +1881,7 @@ async def league_postseason(channel, league): tourneys = league.champ_series() + tourneys[0].increment = true await asyncio.gather(*[start_tournament_round(channel, tourney) for tourney in tourneys]) champs = {} for tourney in tourneys: