favourite order

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1020 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2012-05-30 19:51:20 +00:00
parent d7284ff3ef
commit 895dda6dee
8 changed files with 52 additions and 25 deletions

View File

@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
Version: 0.9.9
Version: 0.9.10
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.0.1),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73),jim-cgi(>=0.5),service-control(>=1.2),busybox(>=1.19.3-1),lsof,epg(>=1.0.9),hmt(>=1.1.6),ssmtp,anacron,trm,openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.1)

View File

@ -68,16 +68,17 @@ set grp 0
foreach res [$rsvdb query {
select eFavGroup,
TBL_FAV.eSvcType,
substr(szSvcName, 2) as szSvcName
substr(szSvcName, 2) as szSvcName,
favIdx
from TBL_FAV join TBL_SVC using (hSvc)
order by eFavGroup
order by eFavGroup, favIdx
}] {
if {$res(eFavGroup) != $grp} {
set grp $res(eFavGroup)
puts " Group $grp"
}
puts " $res(szSvcName)"
puts $fd "fav\t$res(eFavGroup)\t$res(eSvcType)\t$res(szSvcName)"
puts $fd "fav\t$res(eFavGroup)\t$res(eSvcType)\t$res(szSvcName)\t$res(favIdx)"
}
puts "Done."

View File

@ -108,6 +108,8 @@ foreach line $data {
set group [lindex $vals 1]
set type [lindex $vals 2]
set chan [lindex $vals 3]
set idx [lindex $vals 4]
if {$idx eq ""} { set idx 0 }
set hsvc [get_channel_attr $chan]
if {$grp != $group} {
@ -123,8 +125,8 @@ foreach line $data {
}
set query "
insert into pending.fav(hSvc, eFavGroup, eSvcType)
values($hsvc, $group, $type);
insert into pending.fav(favIdx, hSvc, eFavGroup, eSvcType)
values($idx, $hsvc, $group, $type);
"
$rsvdb query $query

View File

@ -29,7 +29,7 @@ if {$stt <= [clock seconds]} {
set current 0
}
set favlist [epg favlist]
set favgroup [[settings] channel_group]
set hours 4.0
set seconds $($hours * 3600)
@ -51,7 +51,13 @@ set secpx $($minpx / 60.0)
set start [clock milliseconds]
if {$::qepg} {
if {$favgroup} {
set records [epg dbfetch dump \
-trange "$stt:$ett" -fav $favgroup]
} else {
set records [epg dbfetch dump -trange "$stt:$ett"]
}
} else {
require channelsort
set records [channelsort [epg fetch dump -trange "$stt:$ett"]]
@ -87,9 +93,6 @@ set lcn 0
set bg "odd"
foreach e $records {
if {$favlist != "" && [$e get service_id] ni $favlist} {
continue
}
set chnum [$e get channel_num]
if {$chnum == 0} { continue }
@ -218,12 +221,12 @@ puts "
</a><br>
"
epg cleanup
set end [clock milliseconds]
puts "<font class=footnote>
Retrieved in: [expr [expr $got - $start] / 1000.0] seconds.
</font>"
epg cleanup
footer

View File

@ -1,3 +1,4 @@
#!/mod/bin/jimsh
puts {
<!-- Start of footer -->

View File

@ -15,15 +15,20 @@ require epg_popup
set start [clock milliseconds]
set now [clock seconds]
set then $($now + 14400)
set favgroup [[settings] channel_group]
if {$::qepg} {
if {$favgroup} {
set records [epg dbfetch dump \
-trange "$now:$then" -fav $favgroup]
} else {
set records [epg dbfetch dump -trange "$now:$then"]
}
} else {
require channelsort
set records [channelsort [epg fetch dump -trange "$now:$then"]]
}
set got [clock milliseconds]
set favlist [epg favlist]
puts {
<small><button id=switch>Switch to grid-style Now/Next</button></small>
@ -43,9 +48,6 @@ puts {
set lcn 0
set num 0
foreach record $records {
if {$favlist != "" && [$record get service_id] ni $favlist} {
continue
}
set chnum [$record get channel_num]
if {$chnum == 0} { continue }

View File

@ -32,7 +32,7 @@ puts {
<!-- start of toolbar -->
<div class=toolbarouter>
<div id=toolbar class=toolbar>
<div id=toolbar class=toolbar style="display: none">
}
tb "/images/323_1_10_Menu_Video.png" "Browse" "/cgi-bin/browse.jim"

View File

@ -334,13 +334,24 @@ proc {epg exec} {mode args} {
proc {epg dbfetch} {mode args} {
set records {}
set extra ""
set q "select distinct *,
set select "
select distinct *,
usLcn as channel_num,
substr(szSvcName, 2) as channel_name,
aucDefaultAuthority as channel_crid,
hSvc as channel_hsvc
"
set from "
from epg.epg e join TBL_SVC c
on e.service_id = c.usSvcId where 1 "
on e.service_id = c.usSvcId
"
set q "where 1 "
set sort "order by channel_num, start"
foreach arg $args {
if {[string first "-" $arg] == 0} {
set v $args($arg)
@ -365,17 +376,23 @@ proc {epg dbfetch} {mode args} {
(e.start < $stt and e.end > $stt)
) "
}
-fav {
append from \
"join TBL_FAV f using(hSvc) "
append q "and f.eFavGroup = $v "
set sort "order by f.favIdx, start"
}
default { error "Invalid option, $arg" }
}
}
}
append q "order by channel_num, start"
#puts "QUERY -$q-"
set query "$select $from $q $sort"
#puts "QUERY -$query-"
set records {}
foreach rec [$::channeldb query $q] {
foreach rec [$::channeldb query $query] {
lappend records [epg new $rec]
}
return $records
@ -401,6 +418,7 @@ proc {epg favlist} {} {
from TBL_SVC join TBL_FAV
using(hSvc)
where TBL_FAV.eFavGroup == $num
order by TBL_FAV.favIdx
"] { lindex $i end }]
}