Expire lone .hmt files from failed recordings
This commit is contained in:
parent
b63a268dac
commit
d3d1755e98
@ -22,8 +22,13 @@ proc ::expire::directory {dir} {
|
||||
set entries [lsort \
|
||||
-command [lambda {a b} {upvar getter g; expr {[$g $a] - [$g $b]}}]\
|
||||
[lmap i [readdir -nocomplain $dir] {
|
||||
if {![string match {*.ts} $i]} continue
|
||||
if {[catch {set ts [ts fetch "$dir/$i"]}]} continue
|
||||
if {[string match {*.hmt} $i]} {
|
||||
if {[file exists "[file rootname $i].ts"]} continue
|
||||
if {[catch {set ts [ts parse "$dir/$i" [ts exec "$dir/$i"]]}]}\
|
||||
continue
|
||||
} elseif {[string match {*.ts} $i]} {
|
||||
if {[catch {set ts [ts fetch "$dir/$i"]}]} continue
|
||||
} else continue
|
||||
if {$ts == 0} continue
|
||||
list $ts
|
||||
}]]
|
||||
@ -43,13 +48,15 @@ proc ::expire::directory {dir} {
|
||||
break
|
||||
}
|
||||
log " [file tail $file]"
|
||||
if {[::auto::inuse $ts]} {
|
||||
log " In use, skipping."
|
||||
continue
|
||||
}
|
||||
if {$ax(keepnew) ne "0" && [$ts flag New]} {
|
||||
log " Unwatched, skipping."
|
||||
continue
|
||||
if {[string match {*.ts} $file]} {
|
||||
if {[::auto::inuse $ts]} {
|
||||
log " In use, skipping."
|
||||
continue
|
||||
}
|
||||
if {$ax(keepnew) ne "0" && [$ts flag New]} {
|
||||
log " Unwatched, skipping."
|
||||
continue
|
||||
}
|
||||
}
|
||||
if {$ax(days) > 0} {
|
||||
# Calculate age in days
|
||||
|
@ -271,7 +271,7 @@ proc {ts fetch} {file {checked 0}} {
|
||||
ts method delete {} {
|
||||
foreach f [$self fileset] {
|
||||
file tdelete $f
|
||||
puts "Removed $f<br>"
|
||||
#puts "Removed $f<br>"
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user