forked from hummypkg/webif
De-couple mux database
This commit is contained in:
parent
db273a8502
commit
83abd2a5cd
@ -1,10 +1,10 @@
|
|||||||
Package: webif
|
Package: webif
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: web
|
Section: web
|
||||||
Version: 1.4.2-14
|
Version: 1.4.2-15
|
||||||
Architecture: mipsel
|
Architecture: mipsel
|
||||||
Maintainer: af123@hpkg.tv
|
Maintainer: af123@hpkg.tv
|
||||||
Depends: tcpfix,webif-channelicons(>=1.1.25),lighttpd(>=1.4.39-1),jim(>=0.77),jim-oo(>=0.77),jim-sqlite3(>=0.77),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.8),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.11),webif-charts(>=1.2-1),stripts(>=1.3.1),tmenu(>=1.21-2),ffmpeg(>=2.8),id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.95),sqlite3(>=3.15.1),jim-xconv
|
Depends: tcpfix,webif-channelicons(>=1.1.26),lighttpd(>=1.4.39-1),jim(>=0.77),jim-oo(>=0.77),jim-sqlite3(>=0.77),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.8),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.11),webif-charts(>=1.2-1),stripts(>=1.3.1),tmenu(>=1.21-2),ffmpeg(>=2.8),id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.95),sqlite3(>=3.15.1),jim-xconv
|
||||||
Suggests:
|
Suggests:
|
||||||
Description: An evolving web interface for the Humax.
|
Description: An evolving web interface for the Humax.
|
||||||
Tags: https://hummy.tv/forum/threads/7712/
|
Tags: https://hummy.tv/forum/threads/7712/
|
||||||
|
@ -70,6 +70,8 @@ if {$cmd eq "update" || $cmd eq "upgrade"} {
|
|||||||
putsf ""
|
putsf ""
|
||||||
putsf "Updating diagnostic meta information"
|
putsf "Updating diagnostic meta information"
|
||||||
pkg fetchdiagmeta
|
pkg fetchdiagmeta
|
||||||
|
putsf "Updating MUX database"
|
||||||
|
pkg fetchmuxdb
|
||||||
}
|
}
|
||||||
|
|
||||||
putsf "Done."
|
putsf "Done."
|
||||||
|
@ -3,20 +3,22 @@
|
|||||||
package require cgi
|
package require cgi
|
||||||
package require sqlite3
|
package require sqlite3
|
||||||
source /mod/webif/lib/setup
|
source /mod/webif/lib/setup
|
||||||
require altrow progressbar epg.class system.class
|
require altrow progressbar epg.class system.class pkg.class
|
||||||
|
|
||||||
header
|
header
|
||||||
|
|
||||||
proc f2c {frequency} {
|
|
||||||
set ch int($((($frequency / 1000) - 303.25) / 8))
|
|
||||||
return [expr int($ch)]
|
|
||||||
}
|
|
||||||
|
|
||||||
if {[catch {set db [sqlite3.open /var/lib/humaxtv/channel.db]} msg]} {
|
if {[catch {set db [sqlite3.open /var/lib/humaxtv/channel.db]} msg]} {
|
||||||
puts "Error opening channel database: $msg"
|
puts "Error opening channel database: $msg"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pkg loadmuxdb
|
||||||
|
|
||||||
|
proc f2c {frequency} {
|
||||||
|
set ch int($((($frequency / 1000) - 303.25) / 8))
|
||||||
|
return [expr int($ch)]
|
||||||
|
}
|
||||||
|
|
||||||
puts "
|
puts "
|
||||||
<div class=va>
|
<div class=va>
|
||||||
<img class=va src=/img/aerials.png height=50>
|
<img class=va src=/img/aerials.png height=50>
|
||||||
@ -75,22 +77,8 @@ foreach tw [$db query {
|
|||||||
lassign $chan x lcn x name
|
lassign $chan x lcn x name
|
||||||
set name [system strip $name]
|
set name [system strip $name]
|
||||||
if {$lcn >= 800} { incr ehs }
|
if {$lcn >= 800} { incr ehs }
|
||||||
switch -glob -- $name {
|
if {[dict exists $::muxdb $name]} {
|
||||||
"BBC NEWS" -
|
set mux $::muxdb($name)
|
||||||
"BBC FOUR" { set mux "PSB1/BBC A" }
|
|
||||||
"Channel 5" -
|
|
||||||
"ITV2" { set mux "PSB2/D3&4" }
|
|
||||||
"Channel 4 HD" -
|
|
||||||
"BBC ONE HD" { set mux "PSB3/BBC B" }
|
|
||||||
"5 USA" -
|
|
||||||
"ITV3" { set mux "COM4/SDN" }
|
|
||||||
"Really" -
|
|
||||||
"Dave" { set mux "COM5/ARQ A" }
|
|
||||||
"4Music" -
|
|
||||||
"Yesterday" { set mux "COM6/ARQ B" }
|
|
||||||
"BBC NEWS HD" { set mux "COM7/ARQ C" }
|
|
||||||
"5STAR+1" -
|
|
||||||
"QVC + 1 HD" { set mux "COM8/ARQ D" }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
puts "<td>$mux</td>"
|
puts "<td>$mux</td>"
|
||||||
|
@ -13,6 +13,7 @@ class pkg {
|
|||||||
|
|
||||||
set ::pkgmeta {}
|
set ::pkgmeta {}
|
||||||
set ::diagmeta {}
|
set ::diagmeta {}
|
||||||
|
set ::muxdb {}
|
||||||
|
|
||||||
pkg method _load {nm} {
|
pkg method _load {nm} {
|
||||||
set name $nm
|
set name $nm
|
||||||
@ -259,6 +260,25 @@ proc {pkg fetchdiagmeta} {} {
|
|||||||
$ff close
|
$ff close
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc {pkg loadmuxdb} {} {
|
||||||
|
if {[llength $::muxdb]} { return }
|
||||||
|
if {![file exists "/mod/var/mux.db"]} {
|
||||||
|
catch {pkg fetchmuxdb}
|
||||||
|
} else {
|
||||||
|
set meta [open "/mod/var/mux.db" r]
|
||||||
|
set ::muxdb [read $meta]
|
||||||
|
$meta close
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
proc {pkg fetchmuxdb} {} {
|
||||||
|
set ::muxdb [pkg fetchfile mux.db]
|
||||||
|
|
||||||
|
set ff [open "/mod/var/mux.db" w]
|
||||||
|
puts $ff $::muxdb
|
||||||
|
$ff close
|
||||||
|
}
|
||||||
|
|
||||||
proc {pkg update} {} {
|
proc {pkg update} {} {
|
||||||
exec /bin/opkg update
|
exec /bin/opkg update
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user