add resetnew
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@933 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
parent
3b8863a4b4
commit
020e1b707c
@ -1,7 +1,7 @@
|
||||
Package: webif
|
||||
Priority: optional
|
||||
Section: web
|
||||
Version: 0.9.6
|
||||
Version: 0.9.6-2
|
||||
Architecture: mipsel
|
||||
Maintainer: af123@hummypkg.org.uk
|
||||
Depends: webif-channelicons,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.1)
|
||||
|
@ -53,6 +53,9 @@ foreach line $data {
|
||||
lappend vars $f [lindex $vals $i]
|
||||
}
|
||||
|
||||
# Don't restore DSO events.
|
||||
if {$vars(ersvtype) == 11} { continue }
|
||||
|
||||
set rsv [rsv new $vars]
|
||||
|
||||
# Need to fix up channel and CRID mappings in case something has
|
||||
|
@ -39,6 +39,7 @@ puts {
|
||||
<li class=cut><a href=#cut>Cut to clipboard</a></li>
|
||||
<li class=pwcopy><a href=#copy>Copy to clipboard</a></li>
|
||||
<li class=separator><a href=#rename>Rename</a></li>
|
||||
<li class=separator><a href=#resetnew>Reset new flag</a></li>
|
||||
}
|
||||
|
||||
if $flatten {
|
||||
|
@ -432,7 +432,12 @@ var dmenuclick = function(action, el, pos)
|
||||
break;
|
||||
|
||||
case 'flat':
|
||||
var url = '/cgi-bin/browse/flat.jim?file=' + file;
|
||||
var url = '/cgi-bin/browse/flat.jim?dir=' + file;
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
break;
|
||||
|
||||
case 'resetnew':
|
||||
var url = '/cgi-bin/browse/resetnew.jim?dir=' + file;
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
break;
|
||||
|
||||
|
@ -9,7 +9,7 @@ puts ""
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set dir [cgi_get file]
|
||||
set dir [cgi_get dir]
|
||||
if {![file isdirectory $dir]} { exit }
|
||||
set noflat 0
|
||||
if {[string match {\[*\]} [file tail $dir]]} {
|
||||
|
@ -1,7 +1,8 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require ts.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
49
var/mongoose/cgi-bin/browse/resetnew.jim
Executable file
49
var/mongoose/cgi-bin/browse/resetnew.jim
Executable file
@ -0,0 +1,49 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
package require pack
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require ts.class hexdump
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set dir [cgi_get dir]
|
||||
if {![file isdirectory $dir]} { exit }
|
||||
if {![file exists "$dir/.series"]} { exit }
|
||||
|
||||
set tot 0
|
||||
set watched 0
|
||||
foreach file [readdir -nocomplain $dir] {
|
||||
if {![string match {*.ts} $file]} { continue }
|
||||
#puts "FILE: $file"
|
||||
incr tot
|
||||
if {[set ts [ts fetch "$dir/$file"]] != 0} {
|
||||
if {![$ts flag "New"]} { incr watched }
|
||||
}
|
||||
}
|
||||
|
||||
set fd [open "$dir/.series"]
|
||||
set bytes [read $fd]
|
||||
close $fd
|
||||
set recs [unpack $bytes -uintle 0 32]
|
||||
set played [unpack $bytes -uintle 32 32]
|
||||
|
||||
puts "Current: $played/$recs"
|
||||
|
||||
#hexdump $bytes
|
||||
|
||||
puts "Calculated: $watched/$tot"
|
||||
|
||||
pack bytes $tot -intle 32 0
|
||||
pack bytes $watched -intle 32 32
|
||||
|
||||
#hexdump $bytes
|
||||
|
||||
set fd [open "$dir/.series" "w"]
|
||||
puts -nonewline $fd $bytes
|
||||
close $fd
|
||||
|
@ -36,6 +36,7 @@ proc get_data {} {
|
||||
set play 0
|
||||
set rec 0
|
||||
set seen {}
|
||||
set output {}
|
||||
|
||||
set data [get_data]
|
||||
if {[llength $data]} {
|
||||
|
30
var/mongoose/lib/hexdump
Normal file
30
var/mongoose/lib/hexdump
Normal file
@ -0,0 +1,30 @@
|
||||
package require binary
|
||||
|
||||
proc hexdump {str} {
|
||||
set s ""
|
||||
set addr 0
|
||||
|
||||
append s "[format "%07x" $addr]: "
|
||||
set t ""
|
||||
for {set i 0} {$i < [string length $str]} {incr i} {
|
||||
if {$i > 0 && [expr $i % 16] == 0} {
|
||||
append s " $t\n"
|
||||
append s "[format "%07x" $addr]: "
|
||||
incr addr 16
|
||||
set t ""
|
||||
} elseif {$i > 0 && [expr $i % 2] == 0} {
|
||||
append s " "
|
||||
}
|
||||
|
||||
set char [string index $str $i]
|
||||
binary scan $char H2 cc
|
||||
append s $cc
|
||||
if {[string is print $char]} {
|
||||
append t $char
|
||||
} else {
|
||||
append t "."
|
||||
}
|
||||
}
|
||||
puts $s
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user