diff --git a/gui/slick/interfaces/default/comingEpisodes.tmpl b/gui/slick/interfaces/default/comingEpisodes.tmpl index f4d1e434..0d754156 100644 --- a/gui/slick/interfaces/default/comingEpisodes.tmpl +++ b/gui/slick/interfaces/default/comingEpisodes.tmpl @@ -121,13 +121,16 @@ #for $cur_result in $sql_results: #set $cur_indexer = int($cur_result["indexer"]) + #set $runtime = $cur_result["runtime"] #if int($cur_result["paused"]) and not $sickbeard.COMING_EPS_DISPLAY_PAUSED: #continue #end if #set $cur_ep_airdate = $cur_result["localtime"].date() - #set $cur_ep_enddate = $cur_result["localtime"] + datetime.timedelta(minutes=$cur_result["runtime"]) + + #if $runtime: + #set $cur_ep_enddate = $cur_result["localtime"] + datetime.timedelta(minutes=$runtime) #if $cur_ep_enddate < $today: #set $show_div = "listing_overdue" #elif $cur_ep_airdate >= $next_week.date(): @@ -139,6 +142,7 @@ #set $show_div = "listing_default" #end if #end if + #end if @@ -220,40 +224,48 @@ #continue #end if + #set $runtime = $cur_result["runtime"] + #if $sort == "network": #if $cur_result["network"] and $cur_segment != $cur_result["network"]:

$cur_result["network"]

#set $cur_segment = $cur_result["network"] #end if #set $cur_ep_airdate = $cur_result["localtime"].date() - #set $cur_ep_enddate = $cur_result["localtime"] + datetime.timedelta(minutes=$cur_result["runtime"]) - #if $cur_ep_enddate < $today: - #set $show_div = "ep_listing listing_overdue" - #elif $cur_ep_airdate >= $next_week.date(): - #set $show_div = "ep_listing listing_toofar" - #elif $cur_ep_enddate >= $today and $cur_ep_airdate < $next_week.date(): - #if $cur_ep_airdate == $today.date(): - #set $show_div = "ep_listing listing_current" - #else: - #set $show_div = "ep_listing listing_default" + + #if $runtime: + #set $cur_ep_enddate = $cur_result["localtime"] + datetime.timedelta(minutes=$runtime) + #if $cur_ep_enddate < $today: + #set $show_div = "ep_listing listing_overdue" + #elif $cur_ep_airdate >= $next_week.date(): + #set $show_div = "ep_listing listing_toofar" + #elif $cur_ep_enddate >= $today and $cur_ep_airdate < $next_week.date(): + #if $cur_ep_airdate == $today.date(): + #set $show_div = "ep_listing listing_current" + #else: + #set $show_div = "ep_listing listing_default" + #end if #end if #end if #elif $sort == "date": #set $cur_ep_airdate = $cur_result["localtime"].date() - #set $cur_ep_enddate = $cur_result["localtime"] + datetime.timedelta(minutes=$cur_result["runtime"]) + #if $cur_segment != $cur_ep_airdate: - #if $cur_ep_enddate < $today and $cur_ep_airdate != $today.date() and not $missed_header: -

Missed

- #set $missed_header = True - #elif $cur_ep_airdate >= $next_week.date() and not $too_late_header: -

Later

- #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]

- #set $today_header = True - #else: -

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

+ #if $runtime: + #set $cur_ep_enddate = $cur_result["localtime"] + datetime.timedelta(minutes=$runtime) + #if $cur_ep_enddate < $today and $cur_ep_airdate != $today.date() and not $missed_header: +

Missed

+ #set $missed_header = True + #elif $cur_ep_airdate >= $next_week.date() and not $too_late_header: +

Later

+ #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]

+ #set $today_header = True + #else: +

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

+ #end if #end if #end if #set $cur_segment = $cur_ep_airdate @@ -268,24 +280,27 @@ #set $show_div = "ep_listing listing_toofar" #elif $cur_ep_enddate >= $today and $cur_ep_airdate < $next_week.date(): #if $cur_ep_airdate == $today.date(): + #set $show_div = "ep_listing listing_current" + #else: + #set $show_div = "ep_listing listing_default" + #end if + #end if + #elif $sort == "show": + #set $cur_ep_airdate = $cur_result["localtime"].date() + + #if $runtime: + #set $cur_ep_enddate = $cur_result["localtime"] + datetime.timedelta(minutes=$runtime) + #if $cur_ep_enddate < $today: + #set $show_div = "ep_listing listing_overdue" + #elif $cur_ep_airdate >= $next_week.date(): + #set $show_div = "ep_listing listing_toofar" + #elif $cur_ep_enddate >= $today and $cur_ep_airdate < $next_week.date(): + #if $cur_ep_airdate == $today.date(): #set $show_div = "ep_listing listing_current" #else: #set $show_div = "ep_listing listing_default" #end if #end if - #elif $sort == "show": - #set $cur_ep_airdate = $cur_result["localtime"].date() - #set $cur_ep_enddate = $cur_result["localtime"] + datetime.timedelta(minutes=$cur_result["runtime"]) - #if $cur_ep_enddate < $today: - #set $show_div = "ep_listing listing_overdue" - #elif $cur_ep_airdate >= $next_week.date(): - #set $show_div = "ep_listing listing_toofar" - #elif $cur_ep_enddate >= $today and $cur_ep_airdate < $next_week.date(): - #if $cur_ep_airdate == $today.date(): - #set $show_div = "ep_listing listing_current" - #else: - #set $show_div = "ep_listing listing_default" - #end if #end if #end if