restructure requires, add initial plugin class and hook into settings

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@220 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg
2011-07-01 22:56:53 +00:00
parent 9116c6e8a9
commit d1cfff8899
17 changed files with 92 additions and 68 deletions

View File

@@ -1,19 +1,18 @@
source /mod/var/mongoose/lib/setup
if {[expr ! [exists -proc class ]]} { package require oo }
if {[expr ! [exists -proc sqlite3.open ]]} { package require sqlite3 }
if {[expr ! [exists -proc settings ]]} {
source /mod/var/mongoose/lib/settings.class
}
if {![exists -proc class ]} { package require oo }
if {![exists -proc sqlite3.open ]} { package require sqlite3 }
if {![exists -proc settings ]} { require settings.class }
source /mod/var/mongoose/lib/progressbar
require progressbar
set channeldb 0
catch { set channeldb [sqlite3.open /var/lib/humaxtv/channel.db] }
set ::channeldb 0
catch { set ::channeldb [sqlite3.open /var/lib/humaxtv/channel.db] }
set epgpath /mnt/hd1/dvbepg/epg.dat
set hdepgpath /media/drive1/epgsavedata
if {![file exists $epgpath] && [file exists $hdepgpath]} {
set epgpath $hdepgpath
set ::epgpath /mnt/hd1/dvbepg/epg.dat
set ::hdepgpath /media/drive1/epgsavedata
if {![file exists $::epgpath] && [file exists $::hdepgpath]} {
set ::epgpath $::hdepgpath
}
# * service_id, event_id, start, duration, encrypted, name, text
@@ -265,3 +264,15 @@ proc {epg favlist} {} {
"] { lindex $i end }]
}
proc {epg channellist} {} {
global channeldb
set channels {}
lmap i [$channeldb query "
select usSvcid, szSvcName
from TBL_SVC
"] { set channels([string range [lindex $i 3] 1 end]) [lindex $i 1] }
return $channels
}