diff --git a/CONTROL/control b/CONTROL/control index 7e8682a..5a4fc13 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,9 +1,9 @@ Package: webif Priority: optional Section: web -Version: 1.0.3-1 +Version: 1.0.4 Architecture: mipsel Maintainer: af123@hummypkg.org.uk -Depends: webif-channelicons(>=1.0.6),mongoose(>=3.0-9),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.1),smartmontools,tmenu(>=1.05),ffmpeg,id3v2 +Depends: webif-channelicons(>=1.1.0),mongoose(>=3.0-9),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.1),smartmontools,tmenu(>=1.05),ffmpeg,id3v2 Suggests: Description: An evolving web interface for the Humax. diff --git a/CONTROL/postinst b/CONTROL/postinst index 5706610..8c50f05 100755 --- a/CONTROL/postinst +++ b/CONTROL/postinst @@ -19,7 +19,7 @@ fi ana=$PKG_ROOT/etc/anacrontab egrep -v 'backup/backup.jim|bin/diskattrs' $ana > $tmpf cat $tmpf - << EOM > $ana -1 8 sched_backup /mod/webife/cgi-bin/backup/backup.jim +1 8 sched_backup /mod/webif/cgi-bin/backup/backup.jim 1 5 diskattrs /mod/webif/lib/bin/diskattrs EOM diff --git a/var/mongoose/cgi-bin/channel.jim b/var/mongoose/cgi-bin/channel.jim index a2c9a26..88a26a3 100755 --- a/var/mongoose/cgi-bin/channel.jim +++ b/var/mongoose/cgi-bin/channel.jim @@ -67,7 +67,7 @@ foreach tw [$db query { "BBC ONE" { set mux "PSB1/BBC A" } "ITV1" { set mux "PSB2/D3&4" } "ITV" { set mux "PSB2/D3&4" } - "BBC One HD" { set mux "PSB3/BBC B (HD)" } + "BBC ONE HD" { set mux "PSB3/BBC B (HD)" } "ITV3" { set mux "COM4/SDN" } "Dave" { set mux "COM5/ARQ A" } "Film4" { set mux "COM6/ARQ B" } diff --git a/var/mongoose/html/browse/resetnew.jim b/var/mongoose/html/browse/resetnew.jim index a378f9c..736d0ec 100755 --- a/var/mongoose/html/browse/resetnew.jim +++ b/var/mongoose/html/browse/resetnew.jim @@ -1,45 +1,12 @@ #!/mod/bin/jimsh package require cgi -package require pack source /mod/webif/lib/setup -require ts.class hexdump +require ts.class httpheader 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 +ts resetnew $dir diff --git a/var/mongoose/html/dedup/dedup.jim b/var/mongoose/html/dedup/dedup.jim index ee299d7..71c8580 100755 --- a/var/mongoose/html/dedup/dedup.jim +++ b/var/mongoose/html/dedup/dedup.jim @@ -26,6 +26,7 @@ puts "
" loadseries $dir +set recalc 0 foreach file [readdir $dir] { set file "$dir/$file" if {[file extension $file] ne ".hmt"} { continue } @@ -52,6 +53,7 @@ foreach file [readdir $dir] { } ts renamegroup $file "_duplicates/$fn" puts -nonewline " - Renamed to _duplicates/$fn" + incr recalc } } error { @@ -78,6 +80,8 @@ foreach file [readdir $dir] { puts "" } +if {$recalc} { ts resetnew $dir } + puts {
diff --git a/var/mongoose/html/edit/edit.jim b/var/mongoose/html/edit/edit.jim index 799c0ef..66e025c 100755 --- a/var/mongoose/html/edit/edit.jim +++ b/var/mongoose/html/edit/edit.jim @@ -23,7 +23,8 @@ puts { Use the Open button below to begin. - +
diff --git a/var/mongoose/lib/bin/auto b/var/mongoose/lib/bin/auto index 31842be..0a10c64 100755 --- a/var/mongoose/lib/bin/auto +++ b/var/mongoose/lib/bin/auto @@ -60,7 +60,7 @@ proc register {type fn} { } } -proc runplugin {name ts} { +proc runplugin {name {ts 0}} { set var "hook_$name" global $var foreach p [subst $$var] { @@ -127,6 +127,15 @@ if {[system pkginst undelete]} { log "Dustbin: $dustbin" 2 +set recalc 0 + +proc dorecalc {dir} { + global recalc + if {!$recalc} return + ts resetnew $dir + set recalc 0 +} + proc dedup {dir} { log "DEDUP: \[$dir]" 2 loop i 0 1 { @@ -156,6 +165,7 @@ proc do_expire {ts} { log " EXPIRE: $file ($age > $ax_days)" 0 log " Deleted." 0 runplugin postexpire $ts + incr ::recalc } } } @@ -531,6 +541,8 @@ proc scan {dir attr {force 0}} {{indent 0}} { } } + dorecalc $dir + incr indent -2 } @@ -545,9 +557,9 @@ if {[llength $argv] > 0} { } else { foreach arg $modules { set st [clock milliseconds] - runplugin "pre${arg}scan" 0 + runplugin "pre${arg}scan" scan $root $arg - runplugin "post${arg}scan" 0 + runplugin "post${arg}scan" log "$arg scan completed in [elapsed $st] seconds." } } diff --git a/var/mongoose/lib/epg.class b/var/mongoose/lib/epg.class index 34cc80d..758814a 100644 --- a/var/mongoose/lib/epg.class +++ b/var/mongoose/lib/epg.class @@ -119,7 +119,7 @@ epg method type_icon {} { } proc {epg channelicon} {name {width 0} {style ""}} { - set str " 0} { append str " width=$width" } if {$style ne ""} { append str " style=\"$style\" } append str " alt=\"\">" @@ -127,7 +127,7 @@ proc {epg channelicon} {name {width 0} {style ""}} { } epg method channel_icon {{width 0} {style ""}} { - set str " 0} { append str " width=$width" } if {$style ne ""} { append str " style=\"$style\" } append str " alt=\"\">" diff --git a/var/mongoose/lib/ts.class b/var/mongoose/lib/ts.class index 281f7b4..4321ae4 100644 --- a/var/mongoose/lib/ts.class +++ b/var/mongoose/lib/ts.class @@ -1,5 +1,6 @@ if {![exists -proc class]} { package require oo } +if {![exists -proc pack]} { package require pack } source /mod/webif/lib/setup require tdelete system.class @@ -333,3 +334,37 @@ proc {ts genrelist} {} { } } +proc {ts resetnew} {dir} { + if {![file isdirectory $dir]} return + if {![file exists "$dir/.series"]} return + + set tot 0 + set watched 0 + foreach file [readdir -nocomplain $dir] { + if {![string match {*.ts} $file]} { continue } + 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 +} +