diff --git a/CONTROL/control b/CONTROL/control index 422eca4b..80575e4d 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,10 +1,10 @@ Package: webif Priority: optional Section: web -Version: 1.3.5 +Version: 1.3.5-1 Architecture: mipsel Maintainer: af123@hpkg.tv -Depends: tcpfix,webif-channelicons(>=1.1.24),lighttpd(>=1.4.39-1),jim(>=0.77),jim-oo(>=0.77),jim-sqlite3(>=0.76),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.5),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.9),webif-charts(>=1.2-1),stripts(>=1.2.5-3),tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.95),sqlite3(>=3.15.1) +Depends: tcpfix,webif-channelicons(>=1.1.24),lighttpd(>=1.4.39-1),jim(>=0.77),jim-oo(>=0.77),jim-sqlite3(>=0.76),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.5),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.9),webif-charts(>=1.2-1),stripts(>=1.2.5-3),tmenu(>=1.21),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.95),sqlite3(>=3.15.1) Suggests: Description: An evolving web interface for the Humax. Tags: http://hummy.tv/forum/threads/7619/ diff --git a/webif/html/browse/mknewdir.jim b/webif/html/browse/mknewdir.jim index 92e289fd..f468395f 100755 --- a/webif/html/browse/mknewdir.jim +++ b/webif/html/browse/mknewdir.jim @@ -2,6 +2,7 @@ package require cgi source /mod/webif/lib/setup +require plugin httpheader @@ -10,3 +11,7 @@ set name [cgi_get newdirname "New Folder"] file mkdir "$dir/$name" +set dir "$dir/$name" + +eval_plugins mkdir + diff --git a/webif/html/diag/queue/fetch.jim b/webif/html/diag/queue/fetch.jim index 13ec1382..67852287 100755 --- a/webif/html/diag/queue/fetch.jim +++ b/webif/html/diag/queue/fetch.jim @@ -17,6 +17,9 @@ foreach q [queue all] { set submitted [clock format [$q get submitted] \ -format {%d/%m/%Y %H:%M:%S}] + set start [$q get start] + if {$start ne "0"} { set start $($start - [clock seconds]) } + if {$flag} { puts "," } else { incr flag } puts "{" puts " \"qid\": [$q get id]," @@ -25,6 +28,7 @@ foreach q [queue all] { puts " \"action\": \"[::json::escape [$q get action]]\"," puts " \"args\": \"[::json::escape [$q get args]]\"," puts " \"status\": \"[$q get status]\"," + puts " \"start\": \"$start\"," puts " \"log\": \"[::json::escape [$q get log]]\"," if {[$q get runtime] > 0} { set time [clock format [lindex [split [$q get runtime] .] 0] \ diff --git a/webif/html/diag/queue/script.js b/webif/html/diag/queue/script.js index e6b2543e..9c63ae94 100644 --- a/webif/html/diag/queue/script.js +++ b/webif/html/diag/queue/script.js @@ -26,6 +26,8 @@ function load() '' + v.status; if (v.status == 'RUNNING') s += '  '; + if ((v.status == 'DEFER' || v.status == 'PENDING') && v.start != '0') + s += '  (' + v.start + 's)'; s += ''; if (v.runtime != '0') s += v.runtime; diff --git a/webif/lib/auto/NOTES b/webif/lib/auto/NOTES index 6f7e6c17..67b5fd9f 100644 --- a/webif/lib/auto/NOTES +++ b/webif/lib/auto/NOTES @@ -140,7 +140,9 @@ The framework will call the following callbacks (if defined within the module): ::module::dequeue De-queue the provided queue item and associated ts file object. - The module must return a list containing [message] + The module must return a list containing [message] [next] + The [next] field is applicable to the DEFER result only and indicates + when the next de-queue attempt should occur. Possible results: @@ -151,8 +153,11 @@ The framework will call the following callbacks (if defined within the module): Examples: return "OK" - return {"OK" "Processing was successful."} - return [list "OK" "Processing was successful."] - return [list "DEFER" "File not yet decrypted."] - return [list "FAILED" "File is already decrypted."] + return {"OK" "Processing was successful"} + return [list "OK" "Processing was successful"] + return [list "DEFER" "File not yet decrypted"] + return [list "DEFER" "Recording in progress" +300] + return [list "DEFER" "Recording in progress" \ + $([clock seconds] + 300)] + return [list "FAILED" "Could not decrypt file"] diff --git a/webif/lib/auto/deq b/webif/lib/auto/deq index b4be7f90..5b869a46 100755 --- a/webif/lib/auto/deq +++ b/webif/lib/auto/deq @@ -175,11 +175,13 @@ for {set qq [::auto::pending]} {[llength $qq]} {set qq [::auto::pending]} { set ::auto::logprefix "$plugin:$::auto::logprefix" set st [clock milliseconds] - lassign [::auto::runplugin $plugin dequeue $q $ts] code msg + lassign [::auto::runplugin $plugin dequeue $q $ts] code msg next set ::auto::logprefix $ologprefix set elapsed [::auto::elapsed $st] - ::auto::log " $code - $msg" 0 + if {[string index $next 0] eq "+"} { incr next [clock seconds] } + + ::auto::log " $code - $msg - $next" 0 switch -- $code { "-1" { ::auto::log " Plugin failure." 0 @@ -189,7 +191,10 @@ for {set qq [::auto::pending]} {[llength $qq]} {set qq [::auto::pending]} { $q update "COMPLETE" "[::auto::date] $msg" 1 $elapsed ::auto::runplugins dequeued $plugin $q $ts } - "DEFER" { $q update "DEFER" $msg 1 $elapsed } + "DEFER" { + if {$next ne ""} { $q set start $next } + $q update "DEFER" $msg 1 $elapsed + } "FAILED" { $q update "FAILED" $msg 1 $elapsed } default { $q update "FAILED" "Unknown response '$code' from plugin" diff --git a/webif/lib/auto/plugin/decrypt/queue.hook b/webif/lib/auto/plugin/decrypt/queue.hook index 23a828ab..02748c0a 100644 --- a/webif/lib/auto/plugin/decrypt/queue.hook +++ b/webif/lib/auto/plugin/decrypt/queue.hook @@ -16,11 +16,31 @@ proc ::decrypt::dequeue {q ts} { } if {![system dlnastatus]} { + if {[system instandby]} { + # Prevent polling every minute + return [list "DEFER" "Cannot decrypt in standby" +300] + } return {"DEFER" "DLNA Server not running"} } if {[::auto::inuse $ts]} { - return {"DEFER" "Recording in use"} + if {[clock seconds] < [$ts get end]} { + if {[$ts get scheddur] == 5700} { + # Likely to be instant-recording. + return [list "DEFER" \ + "Instant-recording in-progress" +300] + } + # Recording in progress, defer until near expected + # end. + set left $([$ts get end] - [clock seconds]) + if {$left > 360} { + return [list "DEFER" "Recording in progress" \ + "+$($left - 300)"] + } else { + return [list "DEFER" "Recording in progress"] + } + } + return [list "DEFER" "Recording in use"] } # Check that the file is not already decrypted by analysing it. diff --git a/webif/lib/auto/plugin/mp3/auto.hook b/webif/lib/auto/plugin/mp3/auto.hook index 4482a09b..8a0e0458 100755 --- a/webif/lib/auto/plugin/mp3/auto.hook +++ b/webif/lib/auto/plugin/mp3/auto.hook @@ -19,7 +19,8 @@ proc ::mp3::ts {ts} { } # Enqueue file - queue insert $ts mp3 + set q [queue insert $ts mp3] + #$q set args "-mp2" ::auto::log " $file - Queued for mp3." 0 }