From 7b6866cdb0971cffde4794f9e3b9b1384531727e Mon Sep 17 00:00:00 2001 From: hummypkg Date: Sun, 5 Mar 2017 19:35:40 +0000 Subject: [PATCH] auto fixes, webif queueactions can take parameters git-svn-id: file:///root/webif/svn/pkg/webif/trunk@3886 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- webif/html/browse/index.jim | 6 +++--- webif/html/browse/queue.jim | 12 +++--------- webif/lib/auto/NOTES | 3 +++ webif/lib/auto/deq | 6 +++++- webif/lib/system.class | 16 ++++++++++++++++ 6 files changed, 31 insertions(+), 14 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index a0e454e8..163a8d6a 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.4.0-16 +Version: 1.4.0-17 Architecture: mipsel Maintainer: af123@hpkg.tv Depends: tcpfix,webif-channelicons(>=1.1.25),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.10),webif-charts(>=1.2-1),stripts(>=1.2.5-3),tmenu(>=1.21-2),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) diff --git a/webif/html/browse/index.jim b/webif/html/browse/index.jim index 3acb7411..e00ea03c 100755 --- a/webif/html/browse/index.jim +++ b/webif/html/browse/index.jim @@ -411,8 +411,8 @@ if {$nicesplice} { # Queue set queueactions(decrypt) "Decryption" set queueactions(shrink) "Shrink" -set queueactions(mp2) "Audio-Extraction (mp2, fast)" -set queueactions(mp3) "Audio-Extraction (mp3, slow)" +dict set queueactions "mp3 -mp2" "Audio-Extraction (mp2, fast)" +dict set queueactions "mp3 -mp3" "Audio-Extraction (mp3, slow)" set queueactions(mpg) "Conversion to MPG" eval_plugins queueactions @@ -425,7 +425,7 @@ Queue for set rqueueactions [lreverse $queueactions] foreach v [lsort [dict keys $rqueueactions]] { set k $rqueueactions($v) - puts "" + puts "" } puts { diff --git a/webif/html/browse/queue.jim b/webif/html/browse/queue.jim index e765326d..6c829246 100755 --- a/webif/html/browse/queue.jim +++ b/webif/html/browse/queue.jim @@ -27,16 +27,10 @@ foreach file [cgi_get files] { set ts [ts fetch $file] if {$ts eq "0"} continue - if {$act eq "mp2"} { - set q [queue insert -hold $ts mp3] - } else { - set q [queue insert -hold $ts $act] - } + lassign $act act args - switch -- $act { - mp2 { $q set args "-mp2" } - mp3 { $q set args "-mp3" } - } + set q [queue insert -hold $ts $act] + if {$args ne ""} { $q set args $args } $q submit puts "" } diff --git a/webif/lib/auto/NOTES b/webif/lib/auto/NOTES index 0c45743f..ea4ed42c 100644 --- a/webif/lib/auto/NOTES +++ b/webif/lib/auto/NOTES @@ -15,10 +15,13 @@ Module Scan De-queue *flatten 750 - *flatview 650 - decrypt 600 900 +*arbookmarks - 500 +*badnts - 500 shrink 400 800 mpg 300 300 mp3 300 300 *detectads 300 200 +*thumbnails - 100 Notes: diff --git a/webif/lib/auto/deq b/webif/lib/auto/deq index 617d9dd7..6984664a 100755 --- a/webif/lib/auto/deq +++ b/webif/lib/auto/deq @@ -133,7 +133,11 @@ proc ::auto::runplugin {plugin fn args} { } proc ::auto::runplugins {fn args} { - foreach plugin [dict keys $::auto::plugins] { + foreach plugin [lsort -decreasing -command [lambda {a b} { + if {$a ni $::auto::plugins} { return 0 } + if {$b ni $::auto::plugins} { return 0 } + return $($::auto::plugins($a) - $::auto::plugins($b)) + }] [dict keys $::auto::plugins]] { set rfn "::${plugin}::${fn}" if {![exists -proc $rfn]} continue if {[catch {uplevel 1 $rfn {*}$args} msg]} { diff --git a/webif/lib/system.class b/webif/lib/system.class index ca2d67a1..f5842121 100644 --- a/webif/lib/system.class +++ b/webif/lib/system.class @@ -114,6 +114,22 @@ proc {system systemid} {} {{id ""}} { return $id } +proc {system macaddr} {} {{mac ""}} { + if {$mac ne ""} { return $mac } + set fd [open /dev/mtd3 r] + + $fd seek 0xc8c00 + set bytes [$fd read 6] + $fd close + set tmac "" + foreach b [split $bytes ""] { + binary scan $b H* hex + if {$tmac ne ""} { append tmac : } + append tmac $hex + } + return [set mac $tmac] +} + proc {system serialno} {} {{serial ""}} { if {$serial ne ""} { return $serial } set fd [open /dev/mtd3 r]