From 732009fd98e6f3d718a8a80913726e8eee561b89 Mon Sep 17 00:00:00 2001 From: Prinz23 Date: Wed, 5 Nov 2014 12:33:05 +0100 Subject: [PATCH] Change how the "local/network" setting is handled to address some issues. Move local/network setting datetime convert into it's own function. Function parse_date_time() now returns when possible a correct timezone aware datetime. Change webapi to use new converter. Fix Daily Searcher. Fix saving old DateTime setting. Add safety check if network_dict is already loaded. --- CHANGES.md | 1 + gui/slick/interfaces/default/displayShow.tmpl | 2 +- gui/slick/interfaces/default/home.tmpl | 6 +- .../default/manage_backlogOverview.tmpl | 74 +++++++++--------- sickbeard/dailysearcher.py | 22 +++++- sickbeard/network_timezones.py | 77 +++++++++---------- sickbeard/sbdatetime.py | 33 ++++++-- sickbeard/webapi.py | 12 +-- sickbeard/webserve.py | 5 +- 9 files changed, 134 insertions(+), 98 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e3c36848..bf36d147 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -54,6 +54,7 @@ * Fix post processing when using tvrage indexer and mediabrowser metadata generation * Change reporting failed network_timezones.txt updates from an error to a warning * Fix missing header and "on " when network is none and Layout "Poster" with Sort By "Network" on coming episodes page. +* Change how the "local/network" setting is handled to address some issues [develop changelog] * Change improve display of progress bars in the Downloads columns of the show list page diff --git a/gui/slick/interfaces/default/displayShow.tmpl b/gui/slick/interfaces/default/displayShow.tmpl index 88ab150f..4de97971 100644 --- a/gui/slick/interfaces/default/displayShow.tmpl +++ b/gui/slick/interfaces/default/displayShow.tmpl @@ -466,7 +466,7 @@ - #if int($epResult["airdate"]) == 1 then "never" else $sbdatetime.sbdatetime.sbfdate($network_timezones.parse_date_time($epResult["airdate"],$show.airs,$show.network))# + #if int($epResult['airdate']) == 1 then 'never' else $sbdatetime.sbdatetime.sbfdate($sbdatetime.sbdatetime.convert_to_setting($network_timezones.parse_date_time($epResult['airdate'],$show.airs,$show.network)))# #if $sickbeard.USE_SUBTITLES and $show.subtitles: diff --git a/gui/slick/interfaces/default/home.tmpl b/gui/slick/interfaces/default/home.tmpl index 33dd6c73..17520e79 100644 --- a/gui/slick/interfaces/default/home.tmpl +++ b/gui/slick/interfaces/default/home.tmpl @@ -329,7 +329,7 @@ $myShowList.sort(lambda x, y: cmp(x.name, y.name)) #set $data_date = '6000000000.0' #if $cur_airs_next: - #set $data_date = $time.mktime($network_timezones.parse_date_time($cur_airs_next,$curShow.airs,$curShow.network).timetuple()) + #set $data_date = $time.mktime($sbdatetime.sbdatetime.convert_to_setting($network_timezones.parse_date_time($cur_airs_next,$curShow.airs,$curShow.network)).timetuple()) #else if None is not $display_status #if 'nded' not in $display_status and 1 == int($curShow.paused) #set $data_date = '5000000500.0' @@ -374,7 +374,7 @@ $myShowList.sort(lambda x, y: cmp(x.name, y.name))
#if $cur_airs_next - #set $ldatetime = $network_timezones.parse_date_time($cur_airs_next,$curShow.airs,$curShow.network) + #set $ldatetime = $sbdatetime.sbdatetime.convert_to_setting($network_timezones.parse_date_time($cur_airs_next,$curShow.airs,$curShow.network)) $sbdatetime.sbdatetime.sbfdate($ldatetime) #else #set $output_html = '?' @@ -526,7 +526,7 @@ $myShowList.sort(lambda x, y: cmp(x.name, y.name)) #if $cur_airs_next - #set $ldatetime = $network_timezones.parse_date_time($cur_airs_next,$curShow.airs,$curShow.network) + #set $ldatetime = $sbdatetime.sbdatetime.convert_to_setting($network_timezones.parse_date_time($cur_airs_next,$curShow.airs,$curShow.network))
$sbdatetime.sbdatetime.sbfdate($ldatetime)
$time.mktime($ldatetime.timetuple()) #else: diff --git a/gui/slick/interfaces/default/manage_backlogOverview.tmpl b/gui/slick/interfaces/default/manage_backlogOverview.tmpl index a4af04de..e83b4180 100644 --- a/gui/slick/interfaces/default/manage_backlogOverview.tmpl +++ b/gui/slick/interfaces/default/manage_backlogOverview.tmpl @@ -2,23 +2,23 @@ #import datetime #from sickbeard.common import * #from sickbeard import sbdatetime, network_timezones -#set global $title="Backlog Overview" -#set global $header="Backlog Overview" +#set global $title = 'Backlog Overview' +#set global $header = 'Backlog Overview' -#set global $sbPath=".." +#set global $sbPath = '..' -#set global $topmenu="manage"# +#set global $topmenu = 'manage'# #import os.path -#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_top.tmpl") +#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl')