From 93cbf651ba8a22fc021da781796ba1e59e5a3ccc Mon Sep 17 00:00:00 2001 From: hummypkg Date: Thu, 4 Apr 2013 22:20:41 +0000 Subject: [PATCH] synchronise scheduled event detection with RS code. Add blue shading git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1521 2a923420-c742-0410-a762-8d5b09965624 --- var/mongoose/cgi-bin/xepg.jim | 5 +++- var/mongoose/lib/epg.class | 44 ++++++++++++++++++++++++++++------- var/mongoose/lib/rsv.class | 34 +++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 10 deletions(-) diff --git a/var/mongoose/cgi-bin/xepg.jim b/var/mongoose/cgi-bin/xepg.jim index a409cd2..4dbc291 100755 --- a/var/mongoose/cgi-bin/xepg.jim +++ b/var/mongoose/cgi-bin/xepg.jim @@ -173,7 +173,10 @@ foreach e $records { clock format $ee -format "%H:%M"])" if {$showing} { append hxt " ($perc%)" } - puts "
= 0} { return $sched_type } set sched_type 0 - if {$event_crid ne "" && "$channel_hsvc$event_crid" in $::rsvlookup} { - set sched_type 1 - } elseif {$series_crid ne "" && - "$channel_hsvc$series_crid" in $::rsvlookup} { - set sched_type 2 + + if {$rsvlookup eq ""} { + set rsvlookup [rsv lookuptab] + #puts $rsvlookup } + + set p 0 + foreach key [list \ + "$service_id:$event_id" \ + [string tolower "$service_id:$channel_crid$series_crid"] \ + [string tolower "$service_id:$channel_crid$event_crid"] \ + ] { + #puts "Check key ($key)" + if {[dict exists $rsvlookup $key]} { + set p $rsvlookup($key) + break + } + } + + switch $p { + S { set sched_type 2 } + E { set sched_type 1 } + default { set sched_type 0 } + } + + return $sched_type } epg method icon_set {{height 0}} { diff --git a/var/mongoose/lib/rsv.class b/var/mongoose/lib/rsv.class index d868ef3..80d3174 100755 --- a/var/mongoose/lib/rsv.class +++ b/var/mongoose/lib/rsv.class @@ -318,6 +318,40 @@ proc {rsv list} {{table tbl_reservation} {extra ""}} { } proc {rsv lookuptab} {} { + set records {} + foreach tab {tbl_reservation pending} { + set res [$::rsvdb query " + select usSvcId, usevtid, ucCRIDType, szCRID, + ucRecKind + from $tab left join channel.TBL_SVC + on $tab.hSvc = channel.TBL_SVC.hSvc + where ersvtype <= 3 + "] + + foreach rec $res { + if {$rec(ucRecKind) == 4} { + set p "S" + } else { + set p "E" + } + set records("$rec(usSvcId):$rec(usevtid)") $p + if {$rec(szCRID) eq ""} continue + if {$rec(ucCRIDType) == 49} { + set p "E" + } elseif {$rec(ucCRIDType) == 50} { + set p "S" + } else { + continue + } + set records([\ + string tolower "$rec(usSvcId):$rec(szCRID)"]) $p + } + } + + return $records +} + +proc {rsv xlookuptab} {} { set records {} foreach tab {tbl_reservation pending} { set res [$::rsvdb query "