Fix problem with EPG v

iew shortly after midnight
This commit is contained in:
xyz321 2020-02-24 14:53:12 +00:00 committed by HummyPkg
parent 7cc8518779
commit 1363fd2f22
3 changed files with 28 additions and 4 deletions

View File

@ -90,6 +90,12 @@ foreach record $records {
set num 0 set num 0
} }
incr num incr num
if {$num == 1} {
if {[$record not_started]} {
puts "<td><i>Unknown</i></td>"
incr num
}
}
if {$num < 4} { if {$num < 4} {
catch { puts [$record cell] } catch { puts [$record cell] }
} }

View File

@ -37,9 +37,12 @@ require epg_popup
set now [clock seconds] set now [clock seconds]
set stt [cgi_get stt $now] set stt [cgi_get stt $now]
if {$stt <= $now} { set dst [expr $now - $stt]
set stt $now if {$dst >= 0 && $dst < 1800} {
set current 1 set current 1
} elseif { $stt < [expr int ($now / 86400) * 86400] } {
set stt $now
set current 0
} else { } else {
set current 0 set current 0
} }
@ -262,16 +265,26 @@ foreach e $records {
if {$es < $stt} { set es $stt } if {$es < $stt} { set es $stt }
if {$ee > $ett} { set ee $ett } if {$ee > $ett} { set ee $ett }
set le $ee
set left [expr int(($es - $stt) * $secpx)] set left [expr int(($es - $stt) * $secpx)]
set right [expr int(($ee - $stt - 1) * $secpx)] set right [expr int(($ee - $stt - 1) * $secpx)]
if {$le == 0 && $es > $stt} {
# EPG data carried over from previous day have been purged
set pos $left
puts "<div class=\"xeprog $bg\"
style=\"width: [expr $pos - 3]px;\" title=\"Unknown\">
<i>Unknown</i></div>"
}
set px $($right - $left) set px $($right - $left)
if {$pos < $left} { if {$pos < $left} {
set px $($px + $left - $pos - 1) set px $($px + $left - $pos - 1)
} elseif {$pos > $left} { } elseif {$pos > $left} {
set px $($px - ($pos - $left - 1)) set px $($px - ($pos - $left - 1))
} }
set le $ee
incr pos $px incr pos $px
$e process_sched $e process_sched

View File

@ -100,6 +100,11 @@ epg method ended {} {
return 0 return 0
} }
epg method not_started {} {
if {$start > [clock seconds]} { return 1 }
return 0
}
epg method elapsed {} { epg method elapsed {} {
set percent [$self percent] set percent [$self percent]
if {$percent == 0} { return 0 } if {$percent == 0} { return 0 }