Change add new zoneinfo_priority parameter to all gettz() calls.

This commit is contained in:
Prinz23 2017-08-05 01:08:28 +02:00 committed by JackDandy
parent 7d068d496b
commit 35b282e797
2 changed files with 5 additions and 4 deletions

View file

@ -78,7 +78,7 @@ def get_tz():
t = get_localzone() t = get_localzone()
if isinstance(t, datetime.tzinfo) and hasattr(t, 'zone') and t.zone and hasattr(sickbeard, 'ZONEINFO_DIR'): if isinstance(t, datetime.tzinfo) and hasattr(t, 'zone') and t.zone and hasattr(sickbeard, 'ZONEINFO_DIR'):
try: try:
t = tz_fallback(tz.gettz(t.zone)) t = tz_fallback(tz.gettz(t.zone, zoneinfo_priority=True))
except: except:
t = tz_fallback(t) t = tz_fallback(t)
else: else:
@ -303,14 +303,15 @@ def get_network_timezone(network):
if not network_dict: if not network_dict:
load_network_dict() load_network_dict()
try: try:
timezone = tz.gettz(network_dupes.get(network) or network_dict.get(network.replace(' ', '').lower())) timezone = tz.gettz(network_dupes.get(network) or network_dict.get(network.replace(' ', '').lower()),
zoneinfo_priority=True)
except: except:
pass pass
if timezone is None: if timezone is None:
cc = re.search(r'\(([a-z]+)\)$', network, flags=re.I) cc = re.search(r'\(([a-z]+)\)$', network, flags=re.I)
try: try:
timezone = tz.gettz(country_timezones.get(cc.group(1).upper())) timezone = tz.gettz(country_timezones.get(cc.group(1).upper()), zoneinfo_priority=True)
except: except:
pass pass
except: except:

View file

@ -224,7 +224,7 @@ class CalendarHandler(BaseHandler):
# Limit dates # Limit dates
past_date = (datetime.date.today() + datetime.timedelta(weeks=-52)).toordinal() past_date = (datetime.date.today() + datetime.timedelta(weeks=-52)).toordinal()
future_date = (datetime.date.today() + datetime.timedelta(weeks=52)).toordinal() future_date = (datetime.date.today() + datetime.timedelta(weeks=52)).toordinal()
utc = tz.gettz('GMT') utc = tz.gettz('GMT', zoneinfo_priority=True)
# Get all the shows that are not paused and are currently on air # Get all the shows that are not paused and are currently on air
myDB = db.DBConnection() myDB = db.DBConnection()