Skip to content

Commit

Permalink
Actually advance when we're mid-inning (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
swemoney authored and ajbowler committed Jul 24, 2018
1 parent 04184e1 commit 41952af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,16 @@ def current_game(self):
def advance_to_next_game(self):
# We only need to check the preferred team's game status if we're
# rotating during mid-innings
if self.config.rotation_preferred_team_live_mid_inning and not self.is_offday_for_preferred_team:
if self.config.rotation_preferred_team_live_mid_inning and not self.is_offday_for_preferred_team():
preferred_overview = self.fetch_preferred_team_overview()
if Status.is_live(preferred_overview.status) and not Status.is_inning_break(preferred_overview.inning_state):
self.current_game_index = self.game_index_for_preferred_team()
self.overview = preferred_overview
self.needs_refresh = False
self.__update_layout_state()
self.print_overview_debug()
else:
self.current_game_index = self.__next_game_index()
return self.current_game()
self.current_game_index = self.__next_game_index()
return self.current_game()

def game_index_for_preferred_team(self):
Expand Down Expand Up @@ -205,7 +205,7 @@ def __next_game_index(self):

def is_offday_for_preferred_team(self):
if self.config.preferred_teams:
return not (next((i for i, game in enumerate(self.games) if self.config.preferred_teams[0] in [game.away_team, game.home_team]), None))
return not (next((i for i, game in enumerate(self.games) if self.config.preferred_teams[0] in [game.away_team, game.home_team]), False))
else:
return True

Expand Down

0 comments on commit 41952af

Please sign in to comment.