Commit e26ad3eb authored by echel0n's avatar echel0n
Browse files

Converted Timezone Updater to class

parent 7e3baa8f
# Changelog # Changelog
- * 30d75a7 - 2018-10-28: Disabled warning for when no nzb/torrent provider is picked if no nzb/torrent client enabled. Disabled search column for display show view if no nzb/torrent is picked. - * 8000c60 - 2018-10-28: Converted Timezone Updater to class
- * 7e3baa8 - 2018-10-28: Disabled warning for when no nzb/torrent provider is picked if no nzb/torrent client enabled. Disabled search column for display show view if no nzb/torrent is picked.
- * 9969a0b - 2018-10-28: Added function to strip accents to encoding functions - * 9969a0b - 2018-10-28: Added function to strip accents to encoding functions
- * bf93454 - 2018-10-27: Release v9.4.1 - * bf93454 - 2018-10-27: Release v9.4.1
- * 3dbd257 - 2018-10-27: Release v9.3.100 - * 3dbd257 - 2018-10-27: Release v9.3.100
......
...@@ -68,7 +68,7 @@ from sickrage.core.searchers.trakt_searcher import TraktSearcher ...@@ -68,7 +68,7 @@ from sickrage.core.searchers.trakt_searcher import TraktSearcher
from sickrage.core.tv.show import TVShow from sickrage.core.tv.show import TVShow
from sickrage.core.ui import Notifications from sickrage.core.ui import Notifications
from sickrage.core.updaters.show_updater import ShowUpdater from sickrage.core.updaters.show_updater import ShowUpdater
from sickrage.core.updaters.tz_updater import update_network_dict from sickrage.core.updaters.tz_updater import TimeZoneUpdater
from sickrage.core.upnp import UPNPClient from sickrage.core.upnp import UPNPClient
from sickrage.core.version_updater import VersionUpdater from sickrage.core.version_updater import VersionUpdater
from sickrage.core.webserver import WebServer from sickrage.core.webserver import WebServer
...@@ -139,6 +139,7 @@ class Core(object): ...@@ -139,6 +139,7 @@ class Core(object):
self.postprocessor_queue = None self.postprocessor_queue = None
self.version_updater = None self.version_updater = None
self.show_updater = None self.show_updater = None
self.tz_updater = None
self.daily_searcher = None self.daily_searcher = None
self.backlog_searcher = None self.backlog_searcher = None
self.proper_searcher = None self.proper_searcher = None
...@@ -175,6 +176,7 @@ class Core(object): ...@@ -175,6 +176,7 @@ class Core(object):
self.postprocessor_queue = PostProcessorQueue() self.postprocessor_queue = PostProcessorQueue()
self.version_updater = VersionUpdater() self.version_updater = VersionUpdater()
self.show_updater = ShowUpdater() self.show_updater = ShowUpdater()
self.tz_updater = TimeZoneUpdater()
self.daily_searcher = DailySearcher() self.daily_searcher = DailySearcher()
self.failed_snatch_searcher = FailedSnatchSearcher() self.failed_snatch_searcher = FailedSnatchSearcher()
self.backlog_searcher = BacklogSearcher() self.backlog_searcher = BacklogSearcher()
...@@ -350,13 +352,13 @@ class Core(object): ...@@ -350,13 +352,13 @@ class Core(object):
# add network timezones updater job # add network timezones updater job
self.scheduler.add_job( self.scheduler.add_job(
update_network_dict, self.tz_updater.run,
IntervalTrigger( IntervalTrigger(
days=1 days=1
), ),
next_run_time=datetime.datetime.now(), next_run_time=datetime.datetime.now(),
name="TZUPDATER", name=self.tz_updater.name,
id="TZUPDATER" id=self.tz_updater.name
) )
# add show updater job # add show updater job
......
...@@ -24,12 +24,11 @@ import datetime ...@@ -24,12 +24,11 @@ import datetime
import sickrage import sickrage
from sickrage.core import helpers from sickrage.core import helpers
from sickrage.core.common import UNAIRED, SKIPPED, statusStrings from sickrage.core.common import UNAIRED, SKIPPED, statusStrings
from sickrage.core.updaters import tz_updater
def new_episode_finder(): def new_episode_finder():
curDate = datetime.date.today() curDate = datetime.date.today()
if tz_updater.network_dict: if sickrage.app.tz_updater.network_dict:
curDate += datetime.timedelta(days=1) curDate += datetime.timedelta(days=1)
else: else:
curDate += datetime.timedelta(days=2) curDate += datetime.timedelta(days=2)
...@@ -55,7 +54,7 @@ def new_episode_finder(): ...@@ -55,7 +54,7 @@ def new_episode_finder():
if show.airs and show.network: if show.airs and show.network:
# This is how you assure it is always converted to local time # This is how you assure it is always converted to local time
air_time = tz_updater.parse_date_time(episode['airdate'], air_time = sickrage.app.tz_updater.parse_date_time(episode['airdate'],
show.airs, show.network).astimezone(sickrage.app.tz) show.airs, show.network).astimezone(sickrage.app.tz)
# filter out any episodes that haven't started airing yet, # filter out any episodes that haven't started airing yet,
......
...@@ -38,7 +38,6 @@ from sickrage.core.helpers import is_media_file, try_int, replaceExtension, \ ...@@ -38,7 +38,6 @@ from sickrage.core.helpers import is_media_file, try_int, replaceExtension, \
from sickrage.core.nameparser import NameParser, InvalidNameException, InvalidShowException from sickrage.core.nameparser import NameParser, InvalidNameException, InvalidShowException
from sickrage.core.processors.post_processor import PostProcessor from sickrage.core.processors.post_processor import PostProcessor
from sickrage.core.scene_numbering import get_scene_absolute_numbering, get_scene_numbering from sickrage.core.scene_numbering import get_scene_absolute_numbering, get_scene_numbering
from sickrage.core.updaters import tz_updater
from sickrage.indexers import IndexerApi from sickrage.indexers import IndexerApi
from sickrage.indexers.exceptions import indexer_seasonnotfound, indexer_error, indexer_episodenotfound from sickrage.indexers.exceptions import indexer_seasonnotfound, indexer_error, indexer_episodenotfound
from sickrage.notifiers import Notifiers from sickrage.notifiers import Notifiers
...@@ -943,7 +942,7 @@ class TVEpisode(object): ...@@ -943,7 +942,7 @@ class TVEpisode(object):
if airdate_ordinal < 1: if airdate_ordinal < 1:
return return
airdatetime = tz_updater.parse_date_time(airdate_ordinal, self.show.airs, self.show.network) airdatetime = sickrage.app.tz_updater.parse_date_time(airdate_ordinal, self.show.airs, self.show.network)
if sickrage.app.config.file_timestamp_timezone == 'local': if sickrage.app.config.file_timestamp_timezone == 'local':
airdatetime = airdatetime.astimezone(sickrage.app.tz) airdatetime = airdatetime.astimezone(sickrage.app.tz)
......
...@@ -23,7 +23,6 @@ import datetime ...@@ -23,7 +23,6 @@ import datetime
import sickrage import sickrage
from sickrage.core.common import Quality, get_quality_string, WANTED, UNAIRED, timeFormat, dateFormat from sickrage.core.common import Quality, get_quality_string, WANTED, UNAIRED, timeFormat, dateFormat
from sickrage.core.helpers.srdatetime import srDateTime from sickrage.core.helpers.srdatetime import srDateTime
from sickrage.core.updaters.tz_updater import parse_date_time
class ComingEpisodes: class ComingEpisodes:
...@@ -111,8 +110,9 @@ class ComingEpisodes: ...@@ -111,8 +110,9 @@ class ComingEpisodes:
results += result(s, e) results += result(s, e)
for index, item in enumerate(results): for index, item in enumerate(results):
results[index]['localtime'] = srDateTime(parse_date_time(item['airdate'], item['airs'], item['network']), results[index]['localtime'] = srDateTime(
convert=True).dt sickrage.app.tz_updater.parse_date_time(item['airdate'], item['airs'], item['network']),
convert=True).dt
results.sort(ComingEpisodes.sorts[sort]) results.sort(ComingEpisodes.sorts[sort])
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import re import re
import threading
from datetime import datetime from datetime import datetime
from CodernityDB.database import RecordNotFound from CodernityDB.database import RecordNotFound
...@@ -30,130 +31,135 @@ from sickrage.core.helpers import try_int ...@@ -30,130 +31,135 @@ from sickrage.core.helpers import try_int
from sickrage.core.helpers.encoding import ss from sickrage.core.helpers.encoding import ss
from sickrage.core.websession import WebSession from sickrage.core.websession import WebSession
network_dict = {}
time_regex = re.compile(r'(?P<hour>\d{1,2})(?:[:.]?(?P<minute>\d{2})?)? ?(?P<meridiem>[PA]\.? ?M?)?\b', re.I)
class TimeZoneUpdater(object):
def __init__(self):
self.name = "TZUPDATER"
self.network_dict = {}
self.time_regex = re.compile(r'(?P<hour>\d{1,2})(?:[:.]?(?P<minute>\d{2})?)? ?(?P<meridiem>[PA]\.? ?M?)?\b',
re.I)
# update the network timezone table def run(self):
def update_network_dict(): # set thread name
"""Update timezone information from SR repositories""" threading.currentThread().setName(self.name)
url = 'https://cdn.sickrage.ca/network_timezones/' self.update_network_dict()
try: # update the network timezone table
url_data = WebSession().get(url).text def update_network_dict(self):
except Exception: """Update timezone information from SR repositories"""
sickrage.app.log.warning(
'Updating network timezones failed, this can happen from time to time. URL: %s' % url)
return
d = {} url = 'https://cdn.sickrage.ca/network_timezones/'
try:
for line in url_data.splitlines():
(key, val) = line.strip().rsplit(':', 1)
if key is None or val is None:
continue
d[key] = val
except (IOError, OSError):
pass
queries = []
for network, timezone in d.items():
existing = network in network_dict
if not existing:
try:
sickrage.app.cache_db.get('network_timezones', network)
except RecordNotFound:
sickrage.app.cache_db.insert({
'_t': 'network_timezones',
'network_name': ss(network),
'timezone': timezone
})
elif network_dict[network] is not timezone:
try:
dbData = sickrage.app.cache_db.get('network_timezones', network)
dbData['timezone'] = timezone
sickrage.app.cache_db.update(dbData)
except RecordNotFound:
continue
if existing:
del network_dict[network]
for x in network_dict:
try: try:
sickrage.app.cache_db.delete(sickrage.app.cache_db.get('network_timezones', x)) url_data = WebSession().get(url).text
except RecordNotFound: except Exception:
continue sickrage.app.log.warning(
'Updating network timezones failed, this can happen from time to time. URL: %s' % url)
load_network_dict() return
d = {}
try:
for line in url_data.splitlines():
(key, val) = line.strip().rsplit(':', 1)
if key is None or val is None:
continue
d[key] = val
except (IOError, OSError):
pass
for network, timezone in d.items():
existing = network in self.network_dict
if not existing:
try:
sickrage.app.cache_db.get('network_timezones', network)
except RecordNotFound:
sickrage.app.cache_db.insert({
'_t': 'network_timezones',
'network_name': ss(network),
'timezone': timezone
})
elif self.network_dict[network] is not timezone:
try:
dbData = sickrage.app.cache_db.get('network_timezones', network)
dbData['timezone'] = timezone
sickrage.app.cache_db.update(dbData)
except RecordNotFound:
continue
if existing:
del self.network_dict[network]
for x in self.network_dict:
try:
sickrage.app.cache_db.delete(sickrage.app.cache_db.get('network_timezones', x))
except RecordNotFound:
continue
# load network timezones from db into dict self.load_network_dict()
def load_network_dict():
"""
Return network timezones from db
"""
global network_dict
network_dict = dict([(x['network_name'], x['timezone']) for x in sickrage.app.cache_db.all('network_timezones')])
# get timezone of a network or return default timezone # load network timezones from db into dict
def get_network_timezone(network): def load_network_dict(self):
""" """
Get a timezone of a network from a given network dict Return network timezones from db
"""
:param network: network to look up (needle) self.network_dict = dict(
:return: [(x['network_name'], x['timezone']) for x in sickrage.app.cache_db.all('network_timezones')])
"""
if network is None:
return sickrage.app.tz
try: # get timezone of a network or return default timezone
return tz.gettz(network_dict[network]) or sickrage.app.tz def get_network_timezone(self, network):
except Exception: """
return sickrage.app.tz Get a timezone of a network from a given network dict
:param network: network to look up (needle)
:return:
"""
if network is None:
return sickrage.app.tz
# parse date and time string into local time try:
def parse_date_time(d, t, network): return tz.gettz(self.network_dict[network]) or sickrage.app.tz
""" except Exception:
Parse date and time string into local time return sickrage.app.tz
:param d: date string
:param t: time string
:param network: network to use as base
:return: datetime object containing local time
"""
if not network_dict: # parse date and time string into local time
load_network_dict() def parse_date_time(self, d, t, network):
"""
Parse date and time string into local time
:param d: date string
:param t: time string
:param network: network to use as base
:return: datetime object containing local time
"""
parsed_time = time_regex.search(t) if not self.network_dict:
network_tz = get_network_timezone(network) self.load_network_dict()
hr = 0 parsed_time = self.time_regex.search(t)
m = 0 network_tz = self.get_network_timezone(network)
if parsed_time: hr = 0
hr = try_int(parsed_time.group('hour')) m = 0
m = try_int(parsed_time.group('minute'))
ap = parsed_time.group('meridiem') if parsed_time:
ap = ap[0].lower() if ap else '' hr = try_int(parsed_time.group('hour'))
m = try_int(parsed_time.group('minute'))
if ap == 'a' and hr == 12: ap = parsed_time.group('meridiem')
hr -= 12 ap = ap[0].lower() if ap else ''
elif ap == 'p' and hr != 12:
hr += 12
hr = hr if 0 <= hr <= 23 else 0 if ap == 'a' and hr == 12:
m = m if 0 <= m <= 59 else 0 hr -= 12
elif ap == 'p' and hr != 12:
hr += 12
result = datetime.fromordinal(max(try_int(d), 1)) hr = hr if 0 <= hr <= 23 else 0
m = m if 0 <= m <= 59 else 0
return result.replace(hour=hr, minute=m, tzinfo=network_tz) result = datetime.fromordinal(max(try_int(d), 1))
return result.replace(hour=hr, minute=m, tzinfo=network_tz)
def test_timeformat(t): def test_timeformat(self, t):
return time_regex.search(t) is not None return self.time_regex.search(t) is not None
...@@ -55,7 +55,6 @@ from sickrage.core.media.poster import Poster ...@@ -55,7 +55,6 @@ from sickrage.core.media.poster import Poster
from sickrage.core.queues.search import BacklogQueueItem, ManualSearchQueueItem from sickrage.core.queues.search import BacklogQueueItem, ManualSearchQueueItem
from sickrage.core.tv.show.coming_episodes import ComingEpisodes from sickrage.core.tv.show.coming_episodes import ComingEpisodes
from sickrage.core.tv.show.history import History from sickrage.core.tv.show.history import History
from sickrage.core.updaters import tz_updater
from sickrage.indexers import IndexerApi from sickrage.indexers import IndexerApi
from sickrage.indexers.exceptions import indexer_error, \ from sickrage.indexers.exceptions import indexer_error, \
indexer_showincomplete, indexer_shownotfound indexer_showincomplete, indexer_shownotfound
...@@ -733,7 +732,7 @@ class CMD_Episode(ApiCall): ...@@ -733,7 +732,7 @@ class CMD_Episode(ApiCall):
# convert stuff to human form # convert stuff to human form
if try_int(episode['airdate'], 1) > 693595: # 1900 if try_int(episode['airdate'], 1) > 693595: # 1900
episode['airdate'] = srdatetime.srDateTime(srdatetime.srDateTime( episode['airdate'] = srdatetime.srDateTime(srdatetime.srDateTime(
tz_updater.parse_date_time(int(episode['airdate']), showObj.airs, showObj.network), sickrage.app.tz_updater.parse_date_time(int(episode['airdate']), showObj.airs, showObj.network),
convert=True).dt).srfdate(d_preset=dateFormat) convert=True).dt).srfdate(d_preset=dateFormat)
else: else:
episode['airdate'] = 'Never' episode['airdate'] = 'Never'
...@@ -1810,7 +1809,7 @@ class CMD_Show(ApiCall): ...@@ -1810,7 +1809,7 @@ class CMD_Show(ApiCall):
if try_int(showObj.next_aired, 1) > 693595: if try_int(showObj.next_aired, 1) > 693595:
dtEpisodeAirs = srdatetime.srDateTime( dtEpisodeAirs = srdatetime.srDateTime(
tz_updater.parse_date_time(showObj.next_aired, showDict['airs'], showDict['network']), convert=True).dt sickrage.app.tz_updater.parse_date_time(showObj.next_aired, showDict['airs'], showDict['network']), convert=True).dt
showDict['airs'] = srdatetime.srDateTime(dtEpisodeAirs).srftime(t_preset=timeFormat).lstrip('0').replace( showDict['airs'] = srdatetime.srDateTime(dtEpisodeAirs).srftime(t_preset=timeFormat).lstrip('0').replace(
' 0', ' ') ' 0', ' ')
showDict['next_ep_airdate'] = srdatetime.srDateTime(dtEpisodeAirs).srfdate(d_preset=dateFormat) showDict['next_ep_airdate'] = srdatetime.srDateTime(dtEpisodeAirs).srfdate(d_preset=dateFormat)
...@@ -2413,7 +2412,7 @@ class CMD_ShowSeasons(ApiCall): ...@@ -2413,7 +2412,7 @@ class CMD_ShowSeasons(ApiCall):
if try_int(row['airdate'], 1) > 693595: # 1900 if try_int(row['airdate'], 1) > 693595: # 1900
dtEpisodeAirs = srdatetime.srDateTime( dtEpisodeAirs = srdatetime.srDateTime(
tz_updater.parse_date_time(row['airdate'], showObj.airs, showObj.network), convert=True).dt sickrage.app.tz_updater.parse_date_time(row['airdate'], showObj.airs, showObj.network), convert=True).dt
row['airdate'] = srdatetime.srDateTime(dtEpisodeAirs).srfdate(d_preset=dateFormat) row['airdate'] = srdatetime.srDateTime(dtEpisodeAirs).srfdate(d_preset=dateFormat)
else: else:
row['airdate'] = 'Never' row['airdate'] = 'Never'
...@@ -2445,7 +2444,7 @@ class CMD_ShowSeasons(ApiCall): ...@@ -2445,7 +2444,7 @@ class CMD_ShowSeasons(ApiCall):
row["quality"] = get_quality_string(quality) row["quality"] = get_quality_string(quality)
if try_int(row['airdate'], 1) > 693595: # 1900 if try_int(row['airdate'], 1) > 693595: # 1900
dtEpisodeAirs = srdatetime.srDateTime( dtEpisodeAirs = srdatetime.srDateTime(
tz_updater.parse_date_time(row['airdate'], showObj.airs, showObj.network), convert=True).dt sickrage.app.tz_updater.parse_date_time(row['airdate'], showObj.airs, showObj.network), convert=True).dt
row['airdate'] = srdatetime.srDateTime(dtEpisodeAirs).srfdate(d_preset=dateFormat) row['airdate'] = srdatetime.srDateTime(dtEpisodeAirs).srfdate(d_preset=dateFormat)
else: else:
row['airdate'] = 'Never' row['airdate'] = 'Never'
...@@ -2693,7 +2692,7 @@ class CMD_Shows(ApiCall): ...@@ -2693,7 +2692,7 @@ class CMD_Shows(ApiCall):
if try_int(curShow.next_aired, 1) > 693595: # 1900 if try_int(curShow.next_aired, 1) > 693595: # 1900
dtEpisodeAirs = srdatetime.srDateTime( dtEpisodeAirs = srdatetime.srDateTime(
tz_updater.parse_date_time(curShow.next_aired, curShow.airs, showDict['network']), convert=True).dt sickrage.app.tz_updater.parse_date_time(curShow.next_aired, curShow.airs, showDict['network']), convert=True).dt
showDict['next_ep_airdate'] = srdatetime.srDateTime(dtEpisodeAirs).srfdate(d_preset=dateFormat) showDict['next_ep_airdate'] = srdatetime.srDateTime(dtEpisodeAirs).srfdate(d_preset=dateFormat)
else: else:
showDict['next_ep_airdate'] = '' showDict['next_ep_airdate'] = ''
......
...@@ -79,7 +79,6 @@ from sickrage.core.traktapi import srTraktAPI ...@@ -79,7 +79,6 @@ from sickrage.core.traktapi import srTraktAPI
from sickrage.core.tv.episode import TVEpisode from sickrage.core.tv.episode import TVEpisode
from sickrage.core.tv.show.coming_episodes import ComingEpisodes from sickrage.core.tv.show.coming_episodes import ComingEpisodes
from sickrage.core.tv.show.history import History as HistoryTool from sickrage.core.tv.show.history import History as HistoryTool
from sickrage.core.updaters import tz_updater
from sickrage.core.webserver import ApiHandler from sickrage.core.webserver import ApiHandler
from sickrage.core.webserver.routes import Route from sickrage.core.webserver.routes import Route
from sickrage.indexers import IndexerApi from sickrage.indexers import IndexerApi
...@@ -372,7 +371,8 @@ class CalendarHandler(BaseHandler): ...@@ -372,7 +371,8 @@ class CalendarHandler(BaseHandler):
for episode in (x for x in sickrage.app.main_db.get_many('tv_episodes', int(show.indexerid)) for episode in (x for x in sickrage.app.main_db.get_many('tv_episodes', int(show.indexerid))
if past_date <= x['airdate'] < future_date): if past_date <= x['airdate'] < future_date):
air_date_time = tz_updater.parse_date_time(episode['airdate'], show.airs, show.network).astimezone(utc) air_date_time = sickrage.app.tz_updater.parse_date_time(episode['airdate'], show.airs,
show.network).astimezone(utc)
air_date_time_end = air_date_time + datetime.timedelta(minutes=try_int(show.runtime, 60)) air_date_time_end = air_date_time + datetime.timedelta(minutes=try_int(show.runtime, 60))
# Create event for episode # Create event for episode
...@@ -1216,8 +1216,9 @@ class Home(WebHandler): ...@@ -1216,8 +1216,9 @@ class Home(WebHandler):
today = datetime.datetime.now().replace(tzinfo=sickrage.app.tz) today = datetime.datetime.now().replace(tzinfo=sickrage.app.tz)
airDate = datetime.datetime.fromordinal(curEp['airdate']) airDate = datetime.datetime.fromordinal(curEp['airdate'])
if airDate.year >= 1970 or showObj.network: if airDate.year >= 1970 or showObj.network:
airDate = srDateTime(tz_updater.parse_date_time(curEp['airdate'], showObj.airs, showObj.network), airDate = srDateTime(
convert=True).dt sickrage.app.tz_updater.parse_date_time(curEp['airdate'], showObj.airs, showObj.network),
convert=True).dt
if curEpCat == Overview.WANTED and airDate < today: if curEpCat == Overview.WANTED and airDate < today:
curEpCat = Overview.MISSED curEpCat = Overview.MISSED
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
import sickrage import sickrage
import sickrage.subtitles import sickrage.subtitles
from sickrage.core.updaters import tz_updater
from sickrage.core.common import SKIPPED, WANTED, UNAIRED, ARCHIVED, IGNORED, FAILED, DOWNLOADED from sickrage.core.common import SKIPPED, WANTED, UNAIRED, ARCHIVED, IGNORED, FAILED, DOWNLOADED
from sickrage.core.common import Quality, qualityPresets, statusStrings, Overview from sickrage.core.common import Quality, qualityPresets, statusStrings, Overview
from sickrage.core.helpers import anon_url, srdatetime, pretty_filesize, get_size from sickrage.core.helpers import anon_url, srdatetime, pretty_filesize, get_size
...@@ -162,7 +161,7 @@ ...@@ -162,7 +161,7 @@
% if show.network and show.airs: % if show.network and show.airs:
<tr> <tr>
<td class="showLegend">${_('Originally Airs:')}</td> <td class="showLegend">${_('Originally Airs:')}</td>
<td>${show.airs} ${("<span style='color: red;'><b>(invalid Timeformat)</b></span> ", "")[tz_updater.test_timeformat(show.airs)]} <td>${show.airs} ${("<span style='color: red;'><b>(invalid Timeformat)</b></span> ", "")[sickrage.app.tz_updater.test_timeformat(show.airs)]}
on ${show.network}</td> on ${show.network}</td>
</tr> </tr>
% elif show.network: % elif show.network:
...@@ -173,7 +172,7 @@ ...@@ -173,7 +172,7 @@
% elif show.airs: % elif show.airs:
<tr> <tr>
<td class="showLegend">${_('Originally Airs:')}</td> <td class="showLegend">${_('Originally Airs:')}</td>
<td>${show.airs} ${("<span style='color: red;'><b>(invalid Timeformat)</b></span>", "")[tz_updater.test_timeformat(show.airs)]}</td> <td>${show.airs} ${("<span style='color: red;'><b>(invalid Timeformat)</b></span>", "")[sickrage.app.tz_updater.test_timeformat(show.airs)]}</td>
</tr> </tr>
% endif % endif