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
This commit is contained in:
hummypkg 2013-04-04 22:20:41 +00:00
parent 26ef83fbff
commit 93cbf651ba
3 changed files with 73 additions and 10 deletions

View File

@ -173,7 +173,10 @@ foreach e $records {
clock format $ee -format "%H:%M"])" clock format $ee -format "%H:%M"])"
if {$showing} { append hxt " ($perc%)" } if {$showing} { append hxt " ($perc%)" }
puts "<div class=\"xeprog $bg\" set lbg $bg
if {[$e scheduled]} { set lbg "blueshade" }
puts "<div class=\"xeprog $lbg\"
style=\"width: [expr $px - 4]px;\" title=\"$htxt\"> style=\"width: [expr $px - 4]px;\" title=\"$htxt\">
<a class=event href=# xs=[$e get service_id] <a class=event href=# xs=[$e get service_id]
xe=[$e get event_id] sch=[$e get sched_type] xe=[$e get event_id] sch=[$e get sched_type]

View File

@ -5,7 +5,6 @@ if {![exists -proc sqlite3.open]} { package require sqlite3 }
require settings.class progressbar rsv.class mwildcard require settings.class progressbar rsv.class mwildcard
set ::epgpath /mnt/hd1/dvbepg/epg.dat set ::epgpath /mnt/hd1/dvbepg/epg.dat
set ::epgdbpath /mnt/hd1/epg.db set ::epgdbpath /mnt/hd1/epg.db
set ::hdepgpath /media/drive1/epgsavedata set ::hdepgpath /media/drive1/epgsavedata
@ -22,8 +21,6 @@ if {[file exists $::epgdbpath]} {
set ::qepg 1 set ::qepg 1
} }
set ::rsvlookup [rsv lookuptab]
# * service_id, event_id, start, duration, encrypted, name, text # * service_id, event_id, start, duration, encrypted, name, text
# * warning, content code, content type, # * warning, content code, content type,
# * event CRID, series CRID, rec CRID # * event CRID, series CRID, rec CRID
@ -48,7 +45,7 @@ class epg {
channel_crid "" channel_crid ""
channel_hsvc 0 channel_hsvc 0
sched_type 0 sched_type -1
rsv 0 rsv 0
} }
@ -175,13 +172,42 @@ epg method get_rsv {} {
} }
epg method process_sched {} { epg method process_sched {} {
$self scheduled
}
set rsvlookup ""
epg method scheduled {} {
global rsvlookup
if {$sched_type >= 0} { return $sched_type }
set sched_type 0 set sched_type 0
if {$event_crid ne "" && "$channel_hsvc$event_crid" in $::rsvlookup} {
set sched_type 1 if {$rsvlookup eq ""} {
} elseif {$series_crid ne "" && set rsvlookup [rsv lookuptab]
"$channel_hsvc$series_crid" in $::rsvlookup} { #puts $rsvlookup
set sched_type 2
} }
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}} { epg method icon_set {{height 0}} {

View File

@ -318,6 +318,40 @@ proc {rsv list} {{table tbl_reservation} {extra ""}} {
} }
proc {rsv lookuptab} {} { 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 {} set records {}
foreach tab {tbl_reservation pending} { foreach tab {tbl_reservation pending} {
set res [$::rsvdb query " set res [$::rsvdb query "