forked from hummypkg/webif
Fix problem with EPG v
iew shortly after midnight
This commit is contained in:
parent
7cc8518779
commit
1363fd2f22
@ -90,6 +90,12 @@ foreach record $records {
|
||||
set num 0
|
||||
}
|
||||
incr num
|
||||
if {$num == 1} {
|
||||
if {[$record not_started]} {
|
||||
puts "<td><i>Unknown</i></td>"
|
||||
incr num
|
||||
}
|
||||
}
|
||||
if {$num < 4} {
|
||||
catch { puts [$record cell] }
|
||||
}
|
||||
|
@ -37,9 +37,12 @@ require epg_popup
|
||||
|
||||
set now [clock seconds]
|
||||
set stt [cgi_get stt $now]
|
||||
if {$stt <= $now} {
|
||||
set stt $now
|
||||
set dst [expr $now - $stt]
|
||||
if {$dst >= 0 && $dst < 1800} {
|
||||
set current 1
|
||||
} elseif { $stt < [expr int ($now / 86400) * 86400] } {
|
||||
set stt $now
|
||||
set current 0
|
||||
} else {
|
||||
set current 0
|
||||
}
|
||||
@ -197,7 +200,7 @@ puts "</div>"
|
||||
|
||||
######################################################################
|
||||
# Events
|
||||
|
||||
|
||||
puts "
|
||||
<script type=text/javascript>
|
||||
var hours = $hours;
|
||||
@ -262,16 +265,26 @@ foreach e $records {
|
||||
|
||||
if {$es < $stt} { set es $stt }
|
||||
if {$ee > $ett} { set ee $ett }
|
||||
set le $ee
|
||||
|
||||
set left [expr int(($es - $stt) * $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)
|
||||
if {$pos < $left} {
|
||||
set px $($px + $left - $pos - 1)
|
||||
} elseif {$pos > $left} {
|
||||
set px $($px - ($pos - $left - 1))
|
||||
}
|
||||
|
||||
set le $ee
|
||||
|
||||
incr pos $px
|
||||
|
||||
$e process_sched
|
||||
|
@ -100,6 +100,11 @@ epg method ended {} {
|
||||
return 0
|
||||
}
|
||||
|
||||
epg method not_started {} {
|
||||
if {$start > [clock seconds]} { return 1 }
|
||||
return 0
|
||||
}
|
||||
|
||||
epg method elapsed {} {
|
||||
set percent [$self percent]
|
||||
if {$percent == 0} { return 0 }
|
||||
|
Loading…
Reference in New Issue
Block a user