diff --git a/nflgame/__init__.py b/nflgame/__init__.py index 0c3b9751..2b82b1d2 100644 --- a/nflgame/__init__.py +++ b/nflgame/__init__.py @@ -434,8 +434,9 @@ def _search_schedule(year=None, week=None, home=None, away=None, kind='REG', for info in nflgame.sched.games.values(): y, t, w = info['year'], info['season_type'], info['week'] h, a = info['home'], info['away'] - if eid is not None and eid != info['eid']: - continue + if eid is not None and eid == info['eid']: + # Always return a non-array if eid is a match + return info if year is not None: if isinstance(year, list) and y not in year: continue diff --git a/nflgame/game.py b/nflgame/game.py index a9b39727..ff474d57 100644 --- a/nflgame/game.py +++ b/nflgame/game.py @@ -264,9 +264,6 @@ def __new__(cls, eid=None, fpath=None, **kwargs): if len(kwargs) == 0: return None - # Flatten the search results - kwargs = kwargs[0] - gameData = { 'home': { 'abbr': kwargs['home'], diff --git a/nflgame/live.py b/nflgame/live.py index a05dace3..b8386b07 100644 --- a/nflgame/live.py +++ b/nflgame/live.py @@ -95,6 +95,10 @@ """ +def current_season_phase(): + _update_week_number() + return _cur_season_phase + def current_year_and_week(): """ Returns a tuple (year, week) where year is the current year of the season @@ -215,6 +219,7 @@ def run(callback, active_interval=15, inactive_interval=900, stop=None): last_week_check = _update_week_number() games = _active_games(inactive_interval) + if active: active = _run_active(callback, games) if not active: