From 13af77c1e45267bf31c43a7ed8028b196a699435 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Wed, 22 Jan 2014 21:18:12 +0000 Subject: [PATCH] various updates git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1768 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- var/mongoose/cgi-bin/settings.jim | 3 ++ var/mongoose/html/pkg/script.js | 5 +++ var/mongoose/include/menuicons.jim | 17 +++++++++- var/mongoose/lib/bin/auto | 54 +++++++++++++++++++++++++++--- var/mongoose/lib/settings.class | 5 +++ 6 files changed, 80 insertions(+), 6 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index ac3d79c8..ffcd6e0e 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.0.7-12 +Version: 1.0.8 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif-channelicons(>=1.1.8),mongoose(>=3.0-9),jim(>=0.74-4),jim-oo,jim-sqlite3(>=0.74-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.3),smartmontools,tmenu(>=1.05),ffmpeg,id3v2,multienv(>=1.6) diff --git a/var/mongoose/cgi-bin/settings.jim b/var/mongoose/cgi-bin/settings.jim index 01ad89ad..89dfd04c 100755 --- a/var/mongoose/cgi-bin/settings.jim +++ b/var/mongoose/cgi-bin/settings.jim @@ -40,6 +40,7 @@ set pkgdev [$settings pkgdev] set notoolbar [$settings notoolbar] set nomobile [$settings nomobile] set nohelplinks [$settings nohelplinks] +set notwitfeed [$settings notwitfeed] set nounwatchedcount [$settings nounwatchedcount] set chanchangenc [$settings chanchangenc] set xepghours [$settings xepghours] @@ -86,6 +87,7 @@ handle_int_update pkgdev $pkgdev "Development Package Display" handle_int_update notoolbar $notoolbar "Disable toolbar" handle_int_update nomobile $nomobile "Disable mobile link" handle_int_update nohelplinks $nohelplinks "Disable help links" +handle_int_update notwitfeed $notwitfeed "Disable twitter feed ticker" handle_int_update chanchangenc $chanchangenc \ "Disable channel change confirmation" handle_int_update nounwatchedcount $nounwatchedcount "Disable unwatched count" @@ -176,6 +178,7 @@ setting_toggle "HTTPS web server?" "https" \ setting_toggle "Slide-down toolbar?" "notoolbar" $(!$notoolbar) 1 setting_toggle "Mobile link on main page?" "nomobile" $(!$nomobile) 1 setting_toggle "Help links on main page?" "nohelplinks" $(!$nohelplinks) 1 +setting_toggle "Twitter feed ticker on main page?" "notwitfeed" $(!$notwitfeed) 1 setting_toggle "Unwatched count on folders?" "nounwatchedcount" $(!$nounwatchedcount) 1 if {[system pkginst ir]} { setting_toggle "Disable channel change confirmation?" \ diff --git a/var/mongoose/html/pkg/script.js b/var/mongoose/html/pkg/script.js index fa30d2b7..b132fb56 100644 --- a/var/mongoose/html/pkg/script.js +++ b/var/mongoose/html/pkg/script.js @@ -60,7 +60,12 @@ $(document).ready(function() { $('#pkgtabs').tabs('option', 'active', tswitch); else + { + $('.ui-tabs-panel') + .html("" + + "Loading data... Please wait..."); $('#pkgtabs').tabs('load', tswitch); + } tswitch = false; $('button.va').enable(); } diff --git a/var/mongoose/include/menuicons.jim b/var/mongoose/include/menuicons.jim index 3eedd7f2..aad38e08 100755 --- a/var/mongoose/include/menuicons.jim +++ b/var/mongoose/include/menuicons.jim @@ -71,10 +71,25 @@ menuitem "Diagnostics" "/img/diagnostics.png" \ eval_plugins menu +if {[$settings notwitfeed] == 0} { + +puts { + + +
+
+} + +} + + if {[$settings nohelplinks] == 0} { menuitem "-reset" "" "" -puts {
} +puts {
} menuitem "hummy.tv
Forums" "/img/forum.png" \ "http://hummy.tv/ target=_blank" 0 100 \ diff --git a/var/mongoose/lib/bin/auto b/var/mongoose/lib/bin/auto index 00382a4f..ed068d01 100755 --- a/var/mongoose/lib/bin/auto +++ b/var/mongoose/lib/bin/auto @@ -18,7 +18,13 @@ if {[file exists $logfile] && [file size $logfile] > 2097152} { file delete $logfile } -set logfd [open "/mod/tmp/auto.log" "a+"] +if {[lindex $argv 0] eq "-d"} { + set argv [lrange $argv 1 end] + set loglevel 2 + set logfd stdout +} else { + set logfd [open "/mod/tmp/auto.log" "a+"] +} proc log {msg {level 1}} { if {$level > $::loglevel} return puts $::logfd "[\ @@ -502,7 +508,7 @@ proc expire {dir} { entries $dir do_expire } -proc scan {dir attr {force 0}} {{indent 0}} { +proc scan {dir attr {force 0} {recurse 1}} {{indent 0}} { global dustbin incr indent 2 @@ -511,6 +517,7 @@ proc scan {dir attr {force 0}} {{indent 0}} { if {$dir eq $dustbin} { log "Dustbin, skipping." 2 + incr indent -2 return } @@ -519,6 +526,7 @@ proc scan {dir attr {force 0}} {{indent 0}} { file stat "$dir/" st if {$st(dev) != $::rootdev} { log "Special folder on different device, skipping." 2 + incr indent -2 return } if {$force} { @@ -538,7 +546,7 @@ proc scan {dir attr {force 0}} {{indent 0}} { if {$force || [file exists "$dir/.auto$attr"]} { $attr $dir } foreach entry [readdir -nocomplain $dir] { - if {[file isdirectory "$dir/$entry"]} { + if {$recurse && [file isdirectory "$dir/$entry"]} { scan "$dir/$entry" $attr $force } } @@ -548,12 +556,50 @@ proc scan {dir attr {force 0}} {{indent 0}} { incr indent -2 } +proc scanup {dir flag} { + global root + + set rl [string length $root] + while {[string length $dir] >= $rl} { + if {[string match {\[*} [file tail $dir]]} { + return -1 + } + if {[file exists "$dir/.auto${flag}r"]} { + log "scanup: Found ${flag}r ($dir)" 2 + return 1 + } + set dir [file dirname $dir] + } + + return 0 +} + +proc scansingle {dirs} { + global modules root + + foreach dir $dirs { + log "Scanning single directory '$dir'" + foreach arg $modules { + set st [clock milliseconds] + set sup [scanup $dir $arg] + if {$sup == -1} { + log "Encountered special directory." + break + } + scan $dir $arg $sup 0 + log "$arg scan completed in [elapsed $st] seconds." + } + } +} + set root [system mediaroot] file stat "$root/" rootstat set rootdev $rootstat(dev) log "Root device: $rootdev" 2 -if {[llength $argv] > 0} { +if {[lindex $argv 0] eq "-single"} { + scansingle [lrange $argv 1 end] +} elseif {[llength $argv] > 0} { set loglevel 2 foreach arg $argv { scan $root $arg } } else { diff --git a/var/mongoose/lib/settings.class b/var/mongoose/lib/settings.class index 6e13d8c0..389830cc 100644 --- a/var/mongoose/lib/settings.class +++ b/var/mongoose/lib/settings.class @@ -25,6 +25,7 @@ class settings { notoolbar 0 nomobile 0 nohelplinks 0 + notwitfeed 0 nounwatchedcount 0 xepghours 4 genrededup 0 @@ -167,6 +168,10 @@ settings method nohelplinks {{val -1}} { return [$self _nval_setting nohelplinks $val] } +settings method notwitfeed {{val -1}} { + return [$self _nval_setting notwitfeed $val] +} + settings method nounwatchedcount {{val -1}} { return [$self _nval_setting nounwatchedcount $val] }