allow guidance removal, skip mounted directories in auto

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1402 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2013-02-12 00:08:54 +00:00
parent 2ab6f7caa2
commit 909342eb1c
4 changed files with 32 additions and 10 deletions

View File

@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
Version: 0.12.0
Version: 0.12.0-1
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.0.4-1),mongoose(>=3.0-7),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.10),hmt(>=1.1.12),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.1.2),smartmontools,tmenu(>=1.05)

View File

@ -25,8 +25,11 @@ if {[file isdirectory $file]} {
if {[catch {
set new [string trim [cgi_get "rename_$attr"]]
set old [$ts get $attr]
if {[string length $new] > 0 && $new ne $old} {
$ts set$attr $new
if {$new ne $old} {
if {$attr eq "guidance" ||
[string length $new] > 0} {
$ts set$attr $new
}
}
} msg]} {
puts "$attr: $msg"

View File

@ -62,8 +62,8 @@ log "Media scan starting, DLNA server status: $dlnaok" 1
proc dsc {{size 0}} {
set free [system diskfree]
# Required disk space is 10GiB + 4 times the file size.
set req $($size * 4 + 10 * 1073741824)
# Required disk space is 1GiB + 3 times the file size.
set req $($size * 3 + 1073741824)
if {$free < $req} {
log "Insufficient disk space. Require=$req, Free=$free" 1
@ -134,6 +134,7 @@ proc do_shrink {ts} {
return
}
set size [$ts size]
dsc $size
startclock
log " SHRINK: $file" 1
log " Estimate $perc% saving." 1
@ -208,6 +209,7 @@ proc do_decrypt {ts} {
}
set size [$ts size]
dsc $size
startclock
log " DECRYPT: $rfile" 1
log " DLNA: $url" 1
@ -267,6 +269,8 @@ proc do_mpg {ts} {
return
}
dsc [$ts size]
log " MPG: $file" 1
log " Converting..." 1
if {[catch {
@ -295,7 +299,7 @@ proc entries {dir callback} {
log "$entry - in use\n" 1
continue
}
dsc [file size "$dir/$entry"]
#dsc [file size "$dir/$entry"]
$callback $ts
}
}
@ -327,9 +331,17 @@ proc scan {dir attr {force 0}} {{indent 0}} {
return
}
if {$force && [string match {\[*} [file tail $dir]]} {
log "Special folder, skipping."
set force 0
if {[string match {\[*} [file tail $dir]]} {
# Special folder
file stat "$dir/" st
if {$st(dev) != $::rootdev} {
log "Special folder on different device, skipping."
return
}
if {$force} {
set force 0
log "Special folder, overriding recursion."
}
}
# Recursion
@ -352,6 +364,9 @@ proc scan {dir attr {force 0}} {{indent 0}} {
}
set root [system mediaroot]
file stat "$root/" rootstat
set rootdev $rootstat(dev)
#log "Root device: $rootdev" 1
if {[llength $argv] > 0} {
if {[lindex $argv 0] eq "test"} { set debug 1 }

View File

@ -180,7 +180,11 @@ ts method setsynopsis {newsynopsis} {
ts method setguidance {newguidance} {
if {[string length newguidance] > 48} { return }
exec /mod/bin/hmt "+setguidance=${newguidance}" $file
if {$newguidance eq ""} {
exec /mod/bin/hmt "-guidance" $file
} else {
exec /mod/bin/hmt "+setguidance=${newguidance}" $file
}
}
ts method setgenre {newgenre} {