add autoskipbin. Improve bin directory derivation

git-svn-id: file:///root/webif/svn/pkg/webif/trunk@3736 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2017-02-12 14:48:46 +00:00
parent 1f98b627d7
commit 1b3aad52d1
7 changed files with 19 additions and 5 deletions

View File

@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
Version: 1.4.0-7
Version: 1.4.0-8
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)

View File

@ -10,6 +10,7 @@ set noautohours [$settings noautohours]
set autofreq [$settings autofreq]
if {$autofreq == 0} { set autofreq 10 }
set toolbarqueue [$settings toolbarqueue]
set autoskipbin [$settings autoskipbin]
handle_int_update autolog $autolog "Auto-processing log level"
handle_int_update noautorec $noautorec "Auto-processing during recording"
@ -20,4 +21,5 @@ handle_int_update autokeep $autokeep "Auto-processing queue period" 1 1 365
handle_int_update autofreq $autofreq "Auto-processing frequency" 1 5 60
handle_str_update noautohours $noautohours "Auto processing hours" ascii
handle_int_update toolbarqueue $toolbarqueue "Toolbar queue icon"
handle_int_update autoskipbin $autoskipbin "Auto-processing dustbin"

View File

@ -82,6 +82,10 @@ setting_number autokeep \
1 365
setting_toggle "Show queue icon in menu/toolbar?" "toolbarqueue" $toolbarqueue
if {[system pkginst undelete]} {
setting_toggle "Create backup files in dustbin for decrypt and shrink?" autoskipbin \
$(!$autoskipbin) 1
}
puts {
</table></fieldset></div>

View File

@ -139,7 +139,7 @@ proc ::decrypt::dequeue {q ts} {
log " Removing/binning old copy." 0
# Move the old recording to the bin if undelete is installed.
if {$::auto::dustbin ne ""} {
if {![$::auto::settings autoskipbin] && $::auto::dustbin ne ""} {
log " finding bin for $file" 0
set bin [_del_bindir $file "webif_autodecrypt"]
log " bin = ($bin)" 0

View File

@ -79,7 +79,11 @@ proc ::shrink::dequeue {q ts} {
}
# Remove the old recording (-> bin if undelete is installed)
if {[$::auto::settings autoskipbin]} {
$ts delete
} else {
safe_delete [$ts get file] "webif_autoshrink"
}
# Finally, rename the shrunken recording again.
foreach ext $tsgroup {

View File

@ -14,8 +14,7 @@ if {![exists -proc _del_bindir]} {
global _del_dustbin
set lbin $_del_dustbin
if {$prefix ne ""} { append lbin "/$prefix" }
set dir [file dirname $file]
regsub "^[system mediaroot]" $dir $lbin ndir
set dir [file normalize [file dirname $file]]
regsub "^[file normalize [system mediaroot]]" $dir $lbin ndir
if {$dir eq $ndir} { set ndir $lbin }
system mkdir_p $ndir

View File

@ -40,6 +40,7 @@ class settings {
noautorecimm 0
autorecperiod 10
autokeep 7
autoskipbin 0
noautohours ""
autofreq 20
autolast 0
@ -254,6 +255,10 @@ settings method autokeep {{val -1}} {
return [$self _nval_setting autokeep $val]
}
settings method autoskipbin {{val -1}} {
return [$self _nval_setting autoskipbin $val]
}
settings method autofreq {{val -1}} {
return [$self _nval_setting autofreq $val]
}