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 \
|
set entries [lsort \
|
||||||
-command [lambda {a b} {upvar getter g; expr {[$g $a] - [$g $b]}}]\
|
-command [lambda {a b} {upvar getter g; expr {[$g $a] - [$g $b]}}]\
|
||||||
[lmap i [readdir -nocomplain $dir] {
|
[lmap i [readdir -nocomplain $dir] {
|
||||||
if {![string match {*.ts} $i]} continue
|
if {[string match {*.hmt} $i]} {
|
||||||
if {[catch {set ts [ts fetch "$dir/$i"]}]} continue
|
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
|
if {$ts == 0} continue
|
||||||
list $ts
|
list $ts
|
||||||
}]]
|
}]]
|
||||||
|
@ -43,13 +48,15 @@ proc ::expire::directory {dir} {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
log " [file tail $file]"
|
log " [file tail $file]"
|
||||||
if {[::auto::inuse $ts]} {
|
if {[string match {*.ts} $file]} {
|
||||||
log " In use, skipping."
|
if {[::auto::inuse $ts]} {
|
||||||
continue
|
log " In use, skipping."
|
||||||
}
|
continue
|
||||||
if {$ax(keepnew) ne "0" && [$ts flag New]} {
|
}
|
||||||
log " Unwatched, skipping."
|
if {$ax(keepnew) ne "0" && [$ts flag New]} {
|
||||||
continue
|
log " Unwatched, skipping."
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if {$ax(days) > 0} {
|
if {$ax(days) > 0} {
|
||||||
# Calculate age in days
|
# Calculate age in days
|
||||||
|
|
|
@ -271,7 +271,7 @@ proc {ts fetch} {file {checked 0}} {
|
||||||
ts method delete {} {
|
ts method delete {} {
|
||||||
foreach f [$self fileset] {
|
foreach f [$self fileset] {
|
||||||
file tdelete $f
|
file tdelete $f
|
||||||
puts "Removed $f<br>"
|
#puts "Removed $f<br>"
|
||||||
}
|
}
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue