From 1e69286c9f192f4487e1249457f4e388effe87c2 Mon Sep 17 00:00:00 2001 From: Prinz23 Date: Sat, 15 Nov 2014 17:02:16 +0100 Subject: [PATCH] Remove unneeded datetime convert from Coming Episodes page. Prevent usage of function .fromtimestamp that can throw exceptions on some platforms. Replace datetime calls with sbdatetime calls. --- CHANGES.md | 1 + gui/slick/interfaces/default/comingEpisodes.tmpl | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c29c6028..1c466f56 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ * Change Add Show on Add Trending Show Page to use the full Add New Show flow * Fix adding shows with titles that contain "&" on Add Trending Show page * Fix unset vars on Add New Shows Page used in the Add Existing Shows context +* Remove unneeded datetime convert from Coming Episodes page ### 0.3.0 (2014-11-12 14:30:00 UTC) diff --git a/gui/slick/interfaces/default/comingEpisodes.tmpl b/gui/slick/interfaces/default/comingEpisodes.tmpl index e278593b..a4645cf7 100644 --- a/gui/slick/interfaces/default/comingEpisodes.tmpl +++ b/gui/slick/interfaces/default/comingEpisodes.tmpl @@ -359,10 +359,10 @@ #set $too_late_header = True #elif $cur_ep_enddate >= $today and $cur_ep_airdate < $next_week.date(): #if $cur_ep_airdate == $today.date(): -

$datetime.date.fromordinal($cur_ep_airdate.toordinal).strftime('%A').decode($sickbeard.SYS_ENCODING).capitalize() [Today]

+

$sbdatetime.sbdatetime.sbfdate($cur_ep_airdate, '%A').decode($sickbeard.SYS_ENCODING).capitalize() [Today]

#set $today_header = True #else: -

$datetime.date.fromordinal($cur_ep_airdate.toordinal).strftime('%A').decode($sickbeard.SYS_ENCODING).capitalize()

+

$sbdatetime.sbdatetime.sbfdate($cur_ep_airdate, '%A').decode($sickbeard.SYS_ENCODING).capitalize()

#end if #end if #end if @@ -371,7 +371,7 @@ #if $cur_ep_airdate == $today.date() and not $today_header:
-

$datetime.date.fromordinal($cur_ep_airdate.toordinal).strftime('%A').decode($sickbeard.SYS_ENCODING).capitalize() [Today]

+

$sbdatetime.sbdatetime.sbfdate($cur_ep_airdate, '%A').decode($sickbeard.SYS_ENCODING).capitalize() [Today]

#set $today_header = True #end if #if $runtime: @@ -489,7 +489,7 @@ #for $day in $dates #set $tbl_day += 1 - + #set $day_has_show = False #for $cur_result in $sql_results: @@ -503,7 +503,7 @@ #if $airday == $day: #set $day_has_show = True - #set $airtime = $sbdatetime.sbdatetime.fromtimestamp($time.mktime($cur_result['localtime'].timetuple())).sbftime().decode($sickbeard.SYS_ENCODING) + #set $airtime = $sbdatetime.sbdatetime.sbftime($cur_result['localtime']).decode($sickbeard.SYS_ENCODING) #if $sickbeard.TRIM_ZERO: #set $airtime = re.sub(r'0(\d:\d\d)', r'\1', $airtime, 0, re.IGNORECASE | re.MULTILINE) #end if
$day.strftime('%A').decode($sickbeard.SYS_ENCODING).capitalize()
$sbdatetime.sbdatetime.sbfdate($day, '%A').decode($sickbeard.SYS_ENCODING).capitalize()