fix ualeventinfo handling

git-svn-id: file:///root/webif/svn/pkg/webif/trunk@2202 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2015-01-15 23:51:58 +00:00
parent ede9be2693
commit 24e1ee5210
5 changed files with 49 additions and 23 deletions

View File

@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
Version: 1.2.0
Version: 1.2.0-1
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.1.14),lighttpd(>=1.4.35-2),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.0),hmt(>=1.2.0),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,mongoose

21
bin/version Executable file
View File

@ -0,0 +1,21 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
require system.class
set modver [system modversion]
set modbuild [system modbuild]
if {$modbuild > 0} {
append modver " (build $modbuild)"
}
catch {set fhtcpversion [system fhtcpversion]}
catch {set kernelver [system kernelver]}
puts "
Humax [system model] Fox T2 ([system hostname])
Humax Version: $fhtcpversion (kernel $kernelver)
Custom firmware version: $modver
Web interface version: [system pkgver webif]
Serial Number: [system serialno]
"

View File

@ -17,5 +17,6 @@ catch {set fhtcpversion [system fhtcpversion]}
catch {set kernelver [system kernelver]}
puts "<br>Humax Version: $fhtcpversion (kernel $kernelver)"
puts "<br>Serial Number: [system serialno]"
puts "</span>"

View File

@ -21,7 +21,7 @@ $rsvdb query {attach database '/var/lib/humaxtv/rsvp.db' as pending}
# version.
catch { $rsvdb query {alter table pending add column action int} }
set binaryfields {aulEventToRecordInfo}
set binaryfields aulEventToRecordInfo
class rsv {
ulslot -1
@ -61,14 +61,9 @@ if {![exists -proc binary]} { package require binary }
rsv method aul {} {
set aul {}
if {[regexp -nocase {^[0-9a-f]+$} $aulEventToRecordInfo} {
if {[catch {
set aulEventToRecordInfo [\
binary format H* $aulEventToRecordInfo]
}]} return $aul
}
for {set i 0} {$i < [string length $aulEventToRecordInfo]} {incr i 16} {
binary scan [string range $aulEventToRecordInfo $i $($i + 15)] \
for {set i 0} {$i < [string length $aulEventToRecordInfo]} {
incr i 16} {
binary scan [string range $aulEventToRecordInfo $i $($i + 15)]\
iiii service start end event_id
catch {lappend aul [list $service $start $end $event_id]}
}
@ -296,17 +291,16 @@ rsv method insert {{table pending} {force 0}} {
}
set vals {}
set bvals {}
foreach field $fields {
set f [$self get $field]
if {$field in $::binaryfields && [string bytelength $f] > 1} {
if {![regexp -nocase {^[0-9a-f]+$} $f} {
binary scan $f H* f
}
lappend vals "X'$f'"
binary scan $f H* fx
lappend bvals $fx
lappend vals "X'%s'"
} else {
# Escape any quotes and percents embedded in the data.
regsub -all {['%]} $f {&&} f
lappend vals "'$f'"
lappend bvals $f
lappend vals "'%s'"
}
}
@ -316,7 +310,10 @@ rsv method insert {{table pending} {force 0}} {
append query [join $vals ","]
append query ");"
$rsvdb query $query
#puts $query
#puts $bvals
$rsvdb query $query {*}$bvals
}
proc {rsv list} {{table tbl_reservation} {extra ""}} {
@ -528,8 +525,7 @@ proc {rsv construct} {event type} {
epg dbfetch dump -scrid [$event get series_crid] \
-sort start] {
if {[set ecrid [$i get event_crid]] eq ""} { continue }
binary scan [rsv mkaul $i] H* ret
lappend events $ret
lappend events [rsv mkaul $i]
list "1$::ccrid$ecrid"
}]
set args(szEventToRecord) "[join $progs "|"]|"
@ -660,7 +656,11 @@ proc {rsv restore} {file} {
continue
}
incr i
lappend vars $f [lindex $vals $i]
set val [lindex $vals $i]
if {$f in $::binaryfields} {
set val [binary format H* $val]
}
lappend vars $f $val
}
# Don't restore DSO events.
@ -708,9 +708,11 @@ proc {rsv restore} {file} {
# Find the new hsvc if possible.
set _hsvc [rsv find_hsvc $lcn $channame]
if {$_hsvc eq ""} continue
puts -nonewline " AUL $channame ($ohsvc"
if {$ohsvc != $_hsvc} {
puts " AUL $channame ($ohsvc -> $_hsvc)"
puts -nonewline " -> $_hsvc"
}
puts ")"
append newaul [binary format iiii \
$_hsvc $start $end $eid]
}
@ -722,6 +724,7 @@ proc {rsv restore} {file} {
puts " Error inserting event, $msg"
}
}
puts ""
}
$rsvdb query {commit transaction;}

View File

@ -111,8 +111,9 @@ proc {system kernelver} {} {{ver ""}} {
"May 27 00:19:40 KST 2012" { format "HD_1.02.28" }
"Jul 5 19:41:17 KST 2012" { format "HD_1.02.29" }
"Oct 13 12:48:09 KST 2012" { format "HD_1.02.31" }
"Dec 9 14:15:07 KST 2014" { format "HD_1.03.02" }
default { format "Unknown - $ver" }
default { format "Unknown - $rver" }
}]
return $ver
}