minor tweaks

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@2053 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2014-10-13 12:32:02 +00:00
parent 987425b22a
commit 61f3868c42
5 changed files with 88 additions and 6 deletions

View File

@ -1,7 +1,7 @@
Package: webif Package: webif
Priority: optional Priority: optional
Section: web Section: web
Version: 1.0.17-1 Version: 1.0.17-2
Architecture: mipsel Architecture: mipsel
Maintainer: af123@hummypkg.org.uk Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.1.13),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(>=1.2),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.0.13),hmt(>=1.1.21),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),mongoose Depends: webif-channelicons(>=1.1.13),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(>=1.2),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.0.13),hmt(>=1.1.21),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),mongoose

View File

@ -33,12 +33,19 @@ set fields [lsort [[rsv] vars]]
set data [split [read $fd] "\n"] set data [split [read $fd] "\n"]
set ver 1
foreach line $data { foreach line $data {
if {[string match "# version *" $line]} {
set ver [lindex [split $line " "] 2]
puts "Backup version $ver"
}
set vals [split $line "\t"] set vals [split $line "\t"]
if {[lindex $vals 0] ne "event"} { continue } if {[lindex $vals 0] ne "event"} { continue }
set vars {} set vars {}
set i 0 set i 0
foreach f $fields { foreach f $fields {
if {$ver < 2 && $f eq "aulEventToRecordInfo"} continue
incr i incr i
lappend vars $f [lindex $vals $i] lappend vars $f [lindex $vals $i]
} }

View File

@ -90,6 +90,6 @@ $(document).ready(function () {
}); });
// For now - until plugins are updated. // For now - until plugins are updated.
$('div.pluginsettings').find('br + br').remove(); //$('div.pluginsettings').find('br + br').remove();
}); });

View File

@ -60,6 +60,10 @@ require findhsvc
if {![exists -proc binary]} { package require binary } if {![exists -proc binary]} { package require binary }
rsv method aul {} { rsv method aul {} {
if {[regexp -nocase {^[0-9a-f]+$} $aulEventToRecordInfo} {
set aulEventToRecordInfo [\
binary format H* $aulEventToRecordInfo]
}
set aul {} set aul {}
for {set i 0} {$i < [string length $aulEventToRecordInfo]} {incr i 16} { for {set i 0} {$i < [string length $aulEventToRecordInfo]} {incr i 16} {
binary scan [string range $aulEventToRecordInfo $i $($i + 15)] \ binary scan [string range $aulEventToRecordInfo $i $($i + 15)] \
@ -79,6 +83,10 @@ proc {rsv mkaul} {e} {
] ]
} }
rsv method setaul {s} {
set aulEventToRecordInfo $s
}
rsv method clear_ulslot {} { rsv method clear_ulslot {} {
set ulslot -1 set ulslot -1
} }
@ -227,6 +235,14 @@ rsv method fix_hsvc {} {
set hsvc $_hsvc set hsvc $_hsvc
} }
proc {rsv find_hsvc} {lcn channel} {
set _hsvc [get_channel_attr $channel]
if {$_hsvc eq ""} {
set _hsvc [get_channel_attr_bylcn $lcn]
}
return $_hsvc
}
rsv method insert {{table pending} {force 0}} { rsv method insert {{table pending} {force 0}} {
global rsvdb global rsvdb
@ -524,6 +540,8 @@ proc {rsv construct} {event type} {
proc {rsv backup} {file} { proc {rsv backup} {file} {
global rsvdb global rsvdb
require epg.class
if {[catch { set fd [open $file w] } msg]} { if {[catch { set fd [open $file w] } msg]} {
error "Error creating backup file. - $msg" error "Error creating backup file. - $msg"
} }
@ -535,6 +553,7 @@ proc {rsv backup} {file} {
set fields [lsort [[rsv] vars]] set fields [lsort [[rsv] vars]]
puts $fd "# version 2" puts $fd "# version 2"
puts $fd "# [join $fields "\t"]" puts $fd "# [join $fields "\t"]"
foreach event $events { foreach event $events {
@ -572,6 +591,20 @@ proc {rsv backup} {file} {
} }
puts "Done." puts "Done."
puts "Backing up channel list..."
foreach channel [epg channellist hSvc] {
lassign $channel name hsvc
puts $fd "hsvc\t$hsvc\t$name"
}
foreach channel [epg channellist usLcn] {
lassign $channel name uslcn
puts $fd "lcn\t$uslcn\t$name"
}
puts "Done."
close $fd close $fd
} }
@ -597,13 +630,27 @@ proc {rsv restore} {file} {
set ver 1 set ver 1
set hsvcmap {}
set lcnmap {}
# Check version, build maps for later.
foreach line $data { foreach line $data {
if {[string match "# version *" $line]} { if {[string match "# version *" $line]} {
set ver [lindex [split $line " "] 2] set ver [lindex [split $line " "] 2]
puts "Backup version $ver" puts "Backup version $ver"
} }
lassign [split $line "\t"] tag hsvc name
if {$tag eq "hsvc"} {
set hsvcmap($hsvc) $name
}
if {$tag eq "lcn"} {
set lcnmap($name) $hsvc
}
}
foreach line $data {
set vals [split $line "\t"] set vals [split $line "\t"]
if {[lindex $vals 0] ne "event"} { continue } if {[lindex $vals 0] ne "event"} continue
set vars {} set vars {}
set i 0 set i 0
foreach f $fields { foreach f $fields {
@ -615,14 +662,14 @@ proc {rsv restore} {file} {
} }
# Don't restore DSO events. # Don't restore DSO events.
if {$vars(ersvtype) == 11} { continue } if {$vars(ersvtype) == 11} continue
set rsv [rsv new $vars] set rsv [rsv new $vars]
# Need to fix up channel and CRID mappings in case something # Need to fix up channel and CRID mappings in case something
# has changed during a channel scan. # has changed during a channel scan.
puts " Restoring [$rsv name]" puts " Restoring [$rsv name] ([$rsv get szSvcName])"
set bad 0 set bad 0
# First, the service number # First, the service number
@ -640,6 +687,34 @@ proc {rsv restore} {file} {
} }
} }
if {!$bad} {
# Need to fix up the AUL table service IDs too.
set newaul ""
foreach aul [$rsv aul] {
# {service start end event_id}
lassign $aul ohsvc start end eid
if {![dict exists $hsvcmap $ohsvc]} {
# Should not happen
puts " Losing AUL entry ($ohsvc)."
continue
}
set lcn 0
set channame $hsvcmap($ohsvc)
if {[dict exists $lcnmap $channame]} {
set lcn $lcnmap($channame)
}
# Find the new hsvc if possible.
set _hsvc [rsv find_hsvc $lcn $channame]
if {$_hsvc eq ""} continue
if {$ohsvc != $_hsvc} {
puts " AUL $channame ($ohsvc -> $_hsvc)"
}
append newaul [binary format iiii \
$_hsvc $start $end $eid]
}
$rsv setaul $newaul
}
if {!$bad} { if {!$bad} {
if {[catch {$rsv insert pending 1} msg]} { if {[catch {$rsv insert pending 1} msg]} {
puts " Error inserting event, $msg" puts " Error inserting event, $msg"

View File

@ -3,8 +3,8 @@ if {![exists -proc require]} {
proc require {args} {{done {}}} { proc require {args} {{done {}}} {
foreach file $args { foreach file $args {
if {$file ni $done} { if {$file ni $done} {
uplevel source "/mod/webif/lib/$file"
lappend done $file lappend done $file
uplevel source "/mod/webif/lib/$file"
} }
} }
} }