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 "