diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 192539d209e406e5b7b0c7d8394fe0b59675b6f6..9dbd1e716cc3189970bba24f397ab49fd75aa75f 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -3902,7 +3902,7 @@ class WebInterface: myDB = db.DBConnection() # Limit dates - past_date = (datetime.date.today() + datetime.timedelta(weeks=-52)).toordinal() + past_date = (datetime.date.today() + datetime.timedelta(weeks=-2)).toordinal() future_date = (datetime.date.today() + datetime.timedelta(weeks=52)).toordinal() # Get all the shows that are not paused and are currently on air (from kjoconnor Fork) @@ -3910,16 +3910,17 @@ class WebInterface: for show in calendar_shows: # Get all episodes of this show airing between today and next month episode_list = myDB.select("SELECT tvdbid, name, season, episode, description, airdate FROM tv_episodes WHERE airdate >= ? AND airdate < ? AND showid = ?", (past_date, future_date, int(show["tvdb_id"]))) + + # Get local timezone and load network timezones + local_zone = tz.tzlocal() + try: + network_zone = network_timezones.get_network_timezone(show['network'], network_timezones.load_network_dict(), local_zone) + except: + # Dummy network_zone for exceptions + network_zone = None for episode in episode_list: - # Get local timezone and load network timezones - local_zone = tz.tzlocal() - try: - network_zone = network_timezones.get_network_timezone(show['network'], network_timezones.load_network_dict(), local_zone) - except: - # Dummy network_zone for exceptions - network_zone = None # Get the air date and time air_date = datetime.datetime.fromordinal(int(episode['airdate']))