2012-05-21 20:23:41 +00:00
|
|
|
source /mod/webif/lib/setup
|
2011-06-07 13:26:45 +00:00
|
|
|
|
2012-01-13 21:23:03 +00:00
|
|
|
if {![exists -proc class]} { package require oo }
|
|
|
|
if {![exists -proc sqlite3.open]} { package require sqlite3 }
|
2011-06-07 13:26:45 +00:00
|
|
|
|
2012-10-30 18:58:54 +00:00
|
|
|
require settings.class progressbar rsv.class mwildcard
|
2011-06-07 13:26:45 +00:00
|
|
|
|
2011-07-01 22:56:53 +00:00
|
|
|
set ::epgpath /mnt/hd1/dvbepg/epg.dat
|
2011-09-29 23:22:02 +00:00
|
|
|
set ::epgdbpath /mnt/hd1/epg.db
|
2011-07-01 22:56:53 +00:00
|
|
|
set ::hdepgpath /media/drive1/epgsavedata
|
|
|
|
if {![file exists $::epgpath] && [file exists $::hdepgpath]} {
|
|
|
|
set ::epgpath $::hdepgpath
|
2011-09-29 23:22:02 +00:00
|
|
|
set ::epgdbpath /media/drive1/epg.db
|
|
|
|
}
|
|
|
|
|
|
|
|
set ::channeldb 0
|
|
|
|
set ::qepg 0
|
|
|
|
catch { set ::channeldb [sqlite3.open /var/lib/humaxtv/channel.db] }
|
|
|
|
if {[file exists $::epgdbpath]} {
|
|
|
|
$::channeldb query {attach database '%s' as epg} $::epgdbpath
|
|
|
|
set ::qepg 1
|
2011-06-23 11:14:57 +00:00
|
|
|
}
|
|
|
|
|
2011-06-07 13:26:45 +00:00
|
|
|
# * service_id, event_id, start, duration, encrypted, name, text
|
|
|
|
# * warning, content code, content type,
|
|
|
|
# * event CRID, series CRID, rec CRID
|
|
|
|
|
|
|
|
class epg {
|
|
|
|
service_id 0
|
|
|
|
event_id 0
|
|
|
|
start 0
|
|
|
|
duration 0
|
|
|
|
encrypted 0
|
|
|
|
name ""
|
|
|
|
text ""
|
|
|
|
warning ""
|
|
|
|
content_code 0
|
|
|
|
content_type ""
|
|
|
|
event_crid ""
|
|
|
|
series_crid ""
|
|
|
|
rec_crid ""
|
|
|
|
|
|
|
|
channel_num 0
|
|
|
|
channel_name ""
|
2011-06-08 23:33:35 +00:00
|
|
|
channel_crid ""
|
2011-07-11 23:29:21 +00:00
|
|
|
channel_hsvc 0
|
|
|
|
|
2013-04-04 22:20:41 +00:00
|
|
|
sched_type -1
|
2011-07-11 23:29:21 +00:00
|
|
|
rsv 0
|
2011-06-07 13:26:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
epg method _parse {line} {
|
|
|
|
set vars [split $line "\t"]
|
|
|
|
|
|
|
|
set service_id [lindex $vars 0]
|
|
|
|
set event_id [lindex $vars 1]
|
|
|
|
set start [lindex $vars 2]
|
|
|
|
set duration [lindex $vars 3]
|
|
|
|
set encrypted [lindex $vars 4]
|
|
|
|
set name [lindex $vars 5]
|
|
|
|
set text [lindex $vars 6]
|
|
|
|
set warning [lindex $vars 7]
|
|
|
|
set content_code [lindex $vars 8]
|
|
|
|
set content_type [lindex $vars 9]
|
|
|
|
set event_crid [lindex $vars 10]
|
|
|
|
set series_crid [lindex $vars 11]
|
|
|
|
set rec_crid [lindex $vars 12]
|
|
|
|
}
|
|
|
|
|
|
|
|
epg method percent {} {
|
|
|
|
set now [clock seconds]
|
|
|
|
if {$start > $now} { return 0 }
|
|
|
|
if {$start + $duration < $now} { return 100 }
|
|
|
|
return [expr [expr $now - $start] * 100 / $duration]
|
|
|
|
}
|
|
|
|
|
|
|
|
epg method showing {} {
|
2011-07-18 19:26:58 +00:00
|
|
|
set now [clock seconds]
|
|
|
|
if {$start > $now} { return 0 }
|
|
|
|
if {$start + $duration < $now} { return 0 }
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
epg method ended {} {
|
|
|
|
if {$start + $duration < [clock seconds]} { return 1 }
|
|
|
|
return 0
|
2011-06-07 13:26:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
epg method elapsed {} {
|
|
|
|
set percent [$self percent]
|
|
|
|
if {$percent == 0} { return 0 }
|
|
|
|
if {$percent == 100} { return $duration }
|
|
|
|
return [expr $duration * $percent / 100]
|
|
|
|
}
|
|
|
|
|
|
|
|
epg method remaining {} {
|
|
|
|
return [expr $duration - [$self elapsed]]
|
|
|
|
}
|
|
|
|
|
2011-06-08 23:33:35 +00:00
|
|
|
epg method type_icon {} {
|
2011-06-07 13:26:45 +00:00
|
|
|
set img ""
|
2011-07-11 23:29:21 +00:00
|
|
|
switch -- $content_code {
|
2011-06-07 13:26:45 +00:00
|
|
|
1 { set img "Movie" }
|
|
|
|
2 { set img "News" }
|
|
|
|
3 { set img "Show" }
|
|
|
|
4 { set img "Sports" }
|
|
|
|
5 { set img "Children" }
|
|
|
|
6 { set img "Music" }
|
|
|
|
7 { set img "Art" }
|
|
|
|
8 { set img "Society" }
|
|
|
|
9 { set img "Education" }
|
|
|
|
10 { set img "Leisure" }
|
|
|
|
}
|
|
|
|
if {$img != ""} {
|
2011-06-08 23:33:35 +00:00
|
|
|
return "/images/173_3_00_G3_$img.png"
|
|
|
|
} else {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-06-14 11:48:55 +00:00
|
|
|
proc {epg channelicon} {name {width 0} {style ""}} {
|
2013-07-11 22:13:36 +00:00
|
|
|
set str "<img src=\"/img/channels/out/$name.png\"";
|
2011-06-14 11:48:55 +00:00
|
|
|
if {$width > 0} { append str " width=$width" }
|
|
|
|
if {$style ne ""} { append str " style=\"$style\" }
|
|
|
|
append str " alt=\"\">"
|
|
|
|
return $str
|
|
|
|
}
|
|
|
|
|
2011-06-09 21:16:30 +00:00
|
|
|
epg method channel_icon {{width 0} {style ""}} {
|
2013-07-11 22:13:36 +00:00
|
|
|
set str "<img src=\"/img/channels/out/$channel_name.png\"";
|
2011-06-09 21:16:30 +00:00
|
|
|
if {$width > 0} { append str " width=$width" }
|
|
|
|
if {$style ne ""} { append str " style=\"$style\" }
|
|
|
|
append str " alt=\"\">"
|
|
|
|
return $str
|
|
|
|
}
|
|
|
|
|
2011-06-14 11:48:55 +00:00
|
|
|
epg method get_channel_info {} {
|
|
|
|
global channeldb
|
|
|
|
|
|
|
|
if {!$channel_num && $channeldb != ""} {
|
|
|
|
set chan [lindex [$channeldb query {
|
2011-07-11 23:29:21 +00:00
|
|
|
select szSvcName, usLcn, aucDefaultAuthority, hsvc
|
2011-06-14 11:48:55 +00:00
|
|
|
from TBL_SVC
|
2011-09-01 22:20:53 +00:00
|
|
|
where usSvcId = '%s'} $service_id
|
2011-06-14 11:48:55 +00:00
|
|
|
] 0]
|
2011-07-09 20:12:33 +00:00
|
|
|
if {[dict exists $chan usLcn]} {
|
|
|
|
set channel_num $chan(usLcn)
|
|
|
|
set channel_name [string range $chan(szSvcName) 1 end]
|
|
|
|
set channel_crid [string toupper $chan(aucDefaultAuthority)]
|
2011-07-11 23:29:21 +00:00
|
|
|
set channel_hsvc $chan(hSvc)
|
2011-07-09 20:12:33 +00:00
|
|
|
}
|
2011-06-14 11:48:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-30 18:58:54 +00:00
|
|
|
epg method copy_channel_info {s} {
|
|
|
|
set channel_num [$s get channel_num]
|
|
|
|
set channel_name [$s get channel_name]
|
|
|
|
set channel_crid [$s get channel_crid]
|
|
|
|
set channel_hsvc [$s get channel_hsvc]
|
|
|
|
}
|
|
|
|
|
2011-07-11 23:29:21 +00:00
|
|
|
epg method get_rsv {} {
|
|
|
|
if {$hsvc == 0} { $self get_channel_info }
|
|
|
|
if {$hsvc == 0} { return }
|
|
|
|
|
|
|
|
if {$rsv == 0 && $event_crid ne ""} {
|
|
|
|
set rsv [rsv entry $event_crid $hsvc]
|
|
|
|
}
|
|
|
|
if {$rsv == 0 && $series_crid ne ""} {
|
|
|
|
set rsv [rsv entry $series_crid $hsvc]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-18 19:26:58 +00:00
|
|
|
epg method process_sched {} {
|
2013-04-04 22:20:41 +00:00
|
|
|
$self scheduled
|
|
|
|
}
|
|
|
|
|
|
|
|
set rsvlookup ""
|
|
|
|
|
|
|
|
epg method scheduled {} {
|
|
|
|
global rsvlookup
|
|
|
|
|
|
|
|
if {$sched_type >= 0} { return $sched_type }
|
2011-07-11 23:29:21 +00:00
|
|
|
set sched_type 0
|
2013-04-04 22:20:41 +00:00
|
|
|
|
|
|
|
if {$rsvlookup eq ""} {
|
|
|
|
set rsvlookup [rsv lookuptab]
|
|
|
|
#puts $rsvlookup
|
2011-06-07 13:26:45 +00:00
|
|
|
}
|
2013-04-04 22:20:41 +00:00
|
|
|
|
|
|
|
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)
|
2013-04-04 22:44:16 +00:00
|
|
|
#puts "FOUND ($p)"
|
2013-04-04 22:20:41 +00:00
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
switch $p {
|
|
|
|
S { set sched_type 2 }
|
|
|
|
E { set sched_type 1 }
|
|
|
|
default { set sched_type 0 }
|
|
|
|
}
|
|
|
|
|
2013-04-04 22:44:16 +00:00
|
|
|
#puts "SCHED_TYPE: ($sched_type)"
|
|
|
|
|
2013-04-04 22:20:41 +00:00
|
|
|
return $sched_type
|
2011-07-18 19:26:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
epg method icon_set {{height 0}} {
|
|
|
|
if {$height > 0} { set height "height=$height" } else { set height "" }
|
|
|
|
set icon [$self type_icon]
|
|
|
|
set set ""
|
|
|
|
if {$icon != ""} {
|
|
|
|
lappend set "<img src=$icon $height
|
|
|
|
alt=\"$content_type\" title=\"$content_type\">"
|
|
|
|
}
|
|
|
|
|
|
|
|
$self process_sched
|
2011-07-19 23:10:32 +00:00
|
|
|
if {$sched_type == 1} {
|
|
|
|
lappend set \
|
|
|
|
"<img src=/images/175_1_11_Reservation_Record.png $height>"
|
|
|
|
}
|
2011-07-11 23:29:21 +00:00
|
|
|
|
|
|
|
if {$sched_type == 2} {
|
|
|
|
lappend set \
|
|
|
|
"<img src=/images/175_1_11_Series_Record.png $height>"
|
|
|
|
} elseif {$series_crid ne ""} {
|
2011-06-09 00:42:26 +00:00
|
|
|
lappend set \
|
2011-06-08 23:33:35 +00:00
|
|
|
"<img src=/images/178_1_00_Icon_Serise.png $height>"
|
2011-06-07 13:26:45 +00:00
|
|
|
}
|
2011-07-11 23:29:21 +00:00
|
|
|
|
|
|
|
if {$rec_crid ne ""} {
|
|
|
|
lappend set \
|
|
|
|
"<img src=/images/178_1_26_Icon_Recommend.png $height>"
|
|
|
|
}
|
|
|
|
|
2011-09-11 21:23:42 +00:00
|
|
|
if {[string match {/*#?} $event_crid]} {
|
|
|
|
lappend set \
|
|
|
|
"<img src=/images/178_1_26_Icon_Split.png $height>"
|
|
|
|
}
|
|
|
|
|
2011-06-09 00:42:26 +00:00
|
|
|
return $set
|
2011-06-08 23:33:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
epg method cell {} {
|
|
|
|
set percent [$self percent]
|
|
|
|
|
2011-09-18 22:19:54 +00:00
|
|
|
puts "<td nowrap valign=top>"
|
2011-06-08 23:33:35 +00:00
|
|
|
|
2011-06-09 00:42:26 +00:00
|
|
|
puts [join [$self icon_set 14] ""]
|
2011-06-08 23:33:35 +00:00
|
|
|
|
2011-07-11 23:29:21 +00:00
|
|
|
if {$series_crid ne ""} {
|
|
|
|
set recopts 2
|
|
|
|
} else {
|
|
|
|
set recopts 1
|
|
|
|
}
|
|
|
|
|
2011-06-07 13:26:45 +00:00
|
|
|
puts "
|
2011-07-11 23:29:21 +00:00
|
|
|
<a class=event href=# xs=$service_id xe=$event_id
|
|
|
|
sch=$sched_type rec=$recopts>
|
|
|
|
$name</a>
|
|
|
|
"
|
2011-06-07 13:26:45 +00:00
|
|
|
|
|
|
|
puts "<br>"
|
|
|
|
|
|
|
|
puts "<font class=footnote>"
|
2011-07-11 23:29:21 +00:00
|
|
|
puts "[clock format $start -format %H:%M]"
|
|
|
|
puts " ([clock format $duration -format %T])"
|
2011-06-07 13:26:45 +00:00
|
|
|
if {$percent > 0 && $percent < 100} {
|
|
|
|
puts "<br>[progressbar $percent]"
|
|
|
|
puts "$percent% [clock format [$self elapsed] -format %T] /
|
|
|
|
[clock format [$self remaining] -format %T]"
|
|
|
|
}
|
|
|
|
puts "</font>"
|
|
|
|
puts "</td>"
|
|
|
|
}
|
|
|
|
|
|
|
|
epg method next {} {
|
2011-07-11 23:29:21 +00:00
|
|
|
set tm $($start + $duration + 60)
|
|
|
|
set nextlist [epg fetch dump -service $service_id -time $tm]
|
2011-06-07 13:26:45 +00:00
|
|
|
|
|
|
|
if {[llength nextlist] > 0} {
|
|
|
|
return [lindex $nextlist 0]
|
|
|
|
} else {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-10-13 23:32:46 +00:00
|
|
|
epg method previous {} {
|
|
|
|
set tm $($start - 60)
|
|
|
|
set prevlist [epg fetch dump -service $service_id -time $tm]
|
|
|
|
|
|
|
|
if {[llength prevlist] > 0} {
|
|
|
|
return [lindex $prevlist 0]
|
|
|
|
} else {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-06-08 23:33:35 +00:00
|
|
|
epg method recommended {} {
|
|
|
|
set rec ""
|
2011-07-11 23:29:21 +00:00
|
|
|
if {$rec_crid ne ""} {
|
2011-06-08 23:33:35 +00:00
|
|
|
catch { set rec [lindex [
|
2011-07-11 23:29:21 +00:00
|
|
|
epg fetch dump -crid $rec_crid] 0] }
|
2011-06-08 23:33:35 +00:00
|
|
|
}
|
|
|
|
return $rec
|
|
|
|
}
|
|
|
|
|
2011-07-18 19:26:58 +00:00
|
|
|
epg method othertimes {} {
|
|
|
|
if {$event_crid eq ""} { return "" }
|
|
|
|
|
|
|
|
set others ""
|
|
|
|
foreach other [epg fetch dump -crid $event_crid] {
|
|
|
|
if {[$other get service_id] == $service_id &&
|
|
|
|
[$other get event_id] == $event_id} { continue }
|
|
|
|
lappend others $other
|
|
|
|
}
|
|
|
|
return $others
|
|
|
|
}
|
|
|
|
|
2011-06-07 13:26:45 +00:00
|
|
|
proc {epg parse} {line} {
|
|
|
|
set e [epg new]
|
|
|
|
$e _parse $line
|
|
|
|
return $e
|
|
|
|
}
|
|
|
|
|
|
|
|
proc {epg cleanup} {} {
|
|
|
|
global channeldb
|
|
|
|
|
2011-06-08 23:33:35 +00:00
|
|
|
if {$channeldb != ""} { $channeldb close }
|
2011-06-07 13:26:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
proc {epg exec} {mode args} {
|
|
|
|
set raw 0
|
2011-06-25 20:59:50 +00:00
|
|
|
set cmd [list /mod/bin/epg -f $::epgpath]
|
2011-06-07 13:26:45 +00:00
|
|
|
set extra ""
|
|
|
|
foreach arg $args {
|
|
|
|
if {[string first "-" $arg] == 0} {
|
|
|
|
switch -- $arg {
|
|
|
|
-raw { set raw 1 }
|
|
|
|
-crid { lappend cmd -C $args($arg) }
|
2011-06-08 23:33:35 +00:00
|
|
|
-scrid { lappend cmd -R $args($arg) }
|
2011-06-07 13:26:45 +00:00
|
|
|
-type { lappend cmd -T $args($arg) }
|
|
|
|
-service { lappend cmd -S $args($arg) }
|
|
|
|
-event { lappend cmd -E $args($arg) }
|
|
|
|
-time { lappend cmd -@ $args($arg) }
|
2011-09-27 20:26:36 +00:00
|
|
|
-trange { lappend cmd -= $args($arg) }
|
2011-08-25 20:30:13 +00:00
|
|
|
-day { lappend cmd -/ $args($arg) }
|
2011-06-07 13:26:45 +00:00
|
|
|
-extra { set extra $args($arg) }
|
|
|
|
default { error "Invalid option, $arg" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if { $raw == 0 } { lappend cmd -p }
|
|
|
|
lappend cmd $mode
|
|
|
|
lappend cmd $extra
|
|
|
|
|
|
|
|
#puts "CMD -$cmd-"
|
|
|
|
|
|
|
|
return [exec {*}$cmd]
|
|
|
|
}
|
|
|
|
|
2011-09-29 23:22:02 +00:00
|
|
|
proc {epg dbfetch} {mode args} {
|
|
|
|
set records {}
|
|
|
|
set extra ""
|
2012-10-30 18:58:54 +00:00
|
|
|
set params {}
|
2012-05-30 19:51:20 +00:00
|
|
|
|
|
|
|
set select "
|
|
|
|
select distinct *,
|
2011-09-29 23:22:02 +00:00
|
|
|
usLcn as channel_num,
|
|
|
|
substr(szSvcName, 2) as channel_name,
|
|
|
|
aucDefaultAuthority as channel_crid,
|
|
|
|
hSvc as channel_hsvc
|
2012-05-30 19:51:20 +00:00
|
|
|
"
|
|
|
|
|
|
|
|
set from "
|
2011-09-29 23:22:02 +00:00
|
|
|
from epg.epg e join TBL_SVC c
|
2012-05-30 19:51:20 +00:00
|
|
|
on e.service_id = c.usSvcId
|
|
|
|
"
|
|
|
|
|
|
|
|
set q "where 1 "
|
|
|
|
|
|
|
|
set sort "order by channel_num, start"
|
|
|
|
|
2011-09-29 23:22:02 +00:00
|
|
|
foreach arg $args {
|
|
|
|
if {[string first "-" $arg] == 0} {
|
|
|
|
set v $args($arg)
|
|
|
|
switch -- $arg {
|
|
|
|
-crid { append q \
|
|
|
|
"and e.event_crid = '$v' " }
|
|
|
|
-scrid { append q \
|
|
|
|
"and e.series_crid = '$v' " }
|
|
|
|
-type { append q \
|
|
|
|
"and e.content_type = $v " }
|
|
|
|
-service { append q \
|
|
|
|
"and e.service_id = $v " }
|
|
|
|
-event { append q \
|
|
|
|
"and e.event_id = $v " }
|
|
|
|
-time { append q \
|
|
|
|
"and e.start < $v and e.end > $v " }
|
2012-10-23 22:51:54 +00:00
|
|
|
-after { append q \
|
|
|
|
"and e.end >= $v " }
|
2011-09-29 23:22:02 +00:00
|
|
|
-trange {
|
|
|
|
lassign [split $v :] stt ett
|
|
|
|
append q "and (
|
|
|
|
(e.start > $stt and e.start < $ett) or
|
|
|
|
(e.end > $stt and e.end < $ett) or
|
|
|
|
(e.start < $stt and e.end > $stt)
|
|
|
|
) "
|
|
|
|
}
|
2012-05-30 19:51:20 +00:00
|
|
|
-fav {
|
|
|
|
append from \
|
|
|
|
"join TBL_FAV f using(hSvc) "
|
|
|
|
append q "and f.eFavGroup = $v "
|
|
|
|
set sort "order by f.favIdx, start"
|
|
|
|
}
|
2012-10-30 18:58:54 +00:00
|
|
|
-term {
|
|
|
|
set v [mwildcard $v]
|
|
|
|
append q "and ("
|
|
|
|
append q "e.name like '%s' "
|
|
|
|
lappend params "%$v%"
|
|
|
|
if {$mode eq "searchall"} {
|
|
|
|
append q \
|
|
|
|
"or e.text like '%s' "
|
|
|
|
lappend params "%$v%"
|
|
|
|
}
|
|
|
|
append q ") "
|
|
|
|
}
|
2011-09-29 23:22:02 +00:00
|
|
|
default { error "Invalid option, $arg" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-05-30 19:51:20 +00:00
|
|
|
set query "$select $from $q $sort"
|
|
|
|
|
|
|
|
#puts "QUERY -$query-"
|
2011-09-29 23:22:02 +00:00
|
|
|
|
|
|
|
set records {}
|
2012-10-30 18:58:54 +00:00
|
|
|
if {[catch {
|
|
|
|
foreach rec [$::channeldb query $query {*}$params] {
|
2012-07-16 20:29:59 +00:00
|
|
|
lappend records [epg new $rec]
|
|
|
|
}
|
2012-10-30 18:58:54 +00:00
|
|
|
} msg]} {
|
2012-11-29 22:28:08 +00:00
|
|
|
puts "No cached EPG data, try again later ($msg)."
|
2011-09-29 23:22:02 +00:00
|
|
|
}
|
|
|
|
return $records
|
|
|
|
}
|
|
|
|
|
2011-06-07 13:26:45 +00:00
|
|
|
proc {epg fetch} {mode args} {
|
2011-06-08 23:33:35 +00:00
|
|
|
set records ""
|
2011-06-07 13:26:45 +00:00
|
|
|
foreach line [split [epg exec $mode {*}$args] "\n"] {
|
2011-06-14 11:48:55 +00:00
|
|
|
lappend records [epg parse $line]
|
2011-06-07 13:26:45 +00:00
|
|
|
}
|
|
|
|
return $records
|
|
|
|
}
|
|
|
|
|
2011-06-14 11:48:55 +00:00
|
|
|
proc {epg favlist} {} {
|
|
|
|
global channeldb
|
|
|
|
|
|
|
|
set num [[settings] channel_group]
|
|
|
|
|
|
|
|
if {!$num} { return "" }
|
|
|
|
|
|
|
|
return [lmap i [$channeldb query "
|
|
|
|
select TBL_SVC.usSvcid
|
|
|
|
from TBL_SVC join TBL_FAV
|
|
|
|
using(hSvc)
|
|
|
|
where TBL_FAV.eFavGroup == $num
|
2012-05-30 19:51:20 +00:00
|
|
|
order by TBL_FAV.favIdx
|
2011-06-14 11:48:55 +00:00
|
|
|
"] { lindex $i end }]
|
|
|
|
}
|
|
|
|
|
2012-10-02 20:05:53 +00:00
|
|
|
proc {epg channellist} {{field usLcn}} {
|
2011-07-01 22:56:53 +00:00
|
|
|
global channeldb
|
|
|
|
|
|
|
|
set channels {}
|
|
|
|
lmap i [$channeldb query "
|
2012-10-02 20:05:53 +00:00
|
|
|
select $field, szSvcName
|
2011-07-01 22:56:53 +00:00
|
|
|
from TBL_SVC
|
2012-10-02 20:05:53 +00:00
|
|
|
order by 1
|
|
|
|
"] { lappend channels [list \
|
|
|
|
[string range [lindex $i 3] 1 end] [lindex $i 1] ] }
|
2011-07-01 22:56:53 +00:00
|
|
|
|
|
|
|
return $channels
|
|
|
|
}
|
|
|
|
|