diff --git a/CONTROL/control b/CONTROL/control index 588779a..87a971a 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.0.16-4 +Version: 1.0.17 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif-channelicons(>=1.1.12-2),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),mongoose diff --git a/webif/cgi-bin/channel.jim b/webif/cgi-bin/channel.jim index 93588f0..10a276d 100755 --- a/webif/cgi-bin/channel.jim +++ b/webif/cgi-bin/channel.jim @@ -3,7 +3,7 @@ package require cgi package require sqlite3 source /mod/webif/lib/setup -require altrow progressbar epg.class +require altrow progressbar epg.class system.class header @@ -51,7 +51,7 @@ foreach tw [$db query { " puts "[progressbar $ucLevel]" puts "[progressbar $ucQuality]" - puts "[string range $netName 3 end]" + puts "[system strip $netName]" set channels [$db query { select usLcn, szSvcName, szPrvName, aucDefaultAuthority diff --git a/webif/cgi-bin/epg/search.jim b/webif/cgi-bin/epg/search.jim index 08dceb7..7ad5baa 100755 --- a/webif/cgi-bin/epg/search.jim +++ b/webif/cgi-bin/epg/search.jim @@ -70,6 +70,7 @@ if {[llength $records] > 0} { Channel Programme Synopsis + } } else { diff --git a/webif/html/backup/view.jim b/webif/html/backup/view.jim index c0ac082..de8bc1e 100755 --- a/webif/html/backup/view.jim +++ b/webif/html/backup/view.jim @@ -39,7 +39,6 @@ foreach line $data { set vars {} set i 0 foreach f $fields { - if {$f eq "aulEventToRecordInfo"} { continue } incr i lappend vars $f [lindex $vals $i] } diff --git a/webif/html/sched/sched.jim b/webif/html/sched/sched.jim index 131ccc7..b4e3385 100755 --- a/webif/html/sched/sched.jim +++ b/webif/html/sched/sched.jim @@ -143,7 +143,16 @@ proc eventrow {event {table TBL_RESERVATION} {pending 0}} { puts " [clock format $start \ - -format {%a %d %b %Y %H:%M}]
" + -format {%a %d %b %Y %H:%M}]" + if {$service_id != [$event get hsvc]} { + set ch [system strip [\ + get_channel_attr_byhsvc \ + $service_id szSvcName]] + puts "\"$ch\"" + } + puts "
" } else { puts "[clock format $start \ -format {%a %d %b %Y %H:%M}] diff --git a/webif/lib/rsv.class b/webif/lib/rsv.class index 35dc2f9..fddcd54 100755 --- a/webif/lib/rsv.class +++ b/webif/lib/rsv.class @@ -21,6 +21,8 @@ $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} + class rsv { ulslot -1 ersvtype 0 @@ -55,9 +57,9 @@ class rsv { } require findhsvc +if {![exists -proc binary]} { package require binary } rsv method aul {} { - if {![exists -proc binary]} { package require binary } set aul {} for {set i 0} {$i < [string length $aulEventToRecordInfo]} {incr i 16} { binary scan [string range $aulEventToRecordInfo $i $($i + 15)] \ @@ -67,6 +69,16 @@ rsv method aul {} { return $aul } +proc {rsv mkaul} {e} { + $e get_channel_info + return [binary format iiii \ + [$e get channel_hsvc] \ + [$e get start] \ + [$e end] \ + [$e get event_id] \ + ] +} + rsv method clear_ulslot {} { set ulslot -1 } @@ -255,7 +267,7 @@ rsv method insert {{table pending} {force 0}} { set fields [lsort [$self vars]] - foreach field {aulEventToRecordInfo szSvcName usLcn sort} { + foreach field {szSvcName usLcn sort} { set df [lsearch $fields $field] set fields [lreplace $fields $df $df] } @@ -267,10 +279,13 @@ rsv method insert {{table pending} {force 0}} { set vals {} foreach field $fields { - # Escape any quotes embedded in the data. - regsub -all {'} [$self get $field] {''} f - lappend vals "'$f'" - #lappend vals "'[$self get $field]'" + # Escape any quotes and percents embedded in the data. + regsub -all {['%]} [$self get $field] {&&} f + if {$field in $::binaryfields} { + lappend vals "X'$f'" + } else { + lappend vals "'$f'" + } } set query "insert into ${table}(" @@ -486,11 +501,17 @@ proc {rsv construct} {event type} { set args(ucRecKind) 4 set args(szCRID) "$ccrid[$event get series_crid]" set args(szFPBRecPath) "$args(szevtname)" - set progs [lmap i [epg fetch dump -scrid [$event get series_crid]] { + set events {} + set progs [lmap i [\ + 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 list "1$::ccrid$ecrid" }] set args(szEventToRecord) "[join $progs "|"]|" + set args(aulEventToRecordInfo) [join $events ""] } return [rsv new $args] @@ -516,8 +537,11 @@ proc {rsv backup} {file} { puts -nonewline $fd "event\t" foreach f $fields { - if {$f eq "aulEventToRecordInfo"} { continue } - puts -nonewline $fd "[$event get $f]\t" + set ret [$event get $f] + if {$f in $::binaryfields} { + binary scan $ret H* ret + } + puts -nonewline $fd "$ret\t" } puts $fd "" } @@ -572,7 +596,6 @@ proc {rsv restore} {file} { set vars {} set i 0 foreach f $fields { - if {$f eq "aulEventToRecordInfo"} { continue } incr i lappend vars $f [lindex $vals $i] } diff --git a/webif/lib/system.class b/webif/lib/system.class index e849ce0..20b6309 100644 --- a/webif/lib/system.class +++ b/webif/lib/system.class @@ -382,3 +382,13 @@ proc {system connectivity} {{site "hpkg.tv"}} { return 1 } +proc {system strip} {str} { + if {[string range $str 1 2] eq "i7"} { + set str [string range $str 3 end] + } + if {[string first "\025" $str] == 0} { + set str [string range $str 1 end] + } + return $str +} +