Compare commits
3 Commits
b24ade080f
...
39d18b4ff0
Author | SHA1 | Date |
---|---|---|
prpr | 39d18b4ff0 | |
prpr | c9100acf66 | |
prpr | 0ab8fb125d |
|
@ -22,12 +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] {
|
||||
set fname "$dir/$i"
|
||||
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"]]}]}\
|
||||
if {[file exists "[file rootname $fname].ts"]} continue
|
||||
if {[catch {set ts [ts parse $fname [ts exec $fname]]}]}\
|
||||
continue
|
||||
} elseif {[string match {*.ts} $i]} {
|
||||
if {[catch {set ts [ts fetch "$dir/$i"]}]} continue
|
||||
if {[catch {set ts [ts fetch $fname]}]} continue
|
||||
} else continue
|
||||
if {$ts == 0} continue
|
||||
list $ts
|
||||
|
@ -68,11 +69,9 @@ proc ::expire::directory {dir} {
|
|||
}
|
||||
}
|
||||
log " Removing."
|
||||
if {![safe_delete $file]} {
|
||||
log "Unknown error in safe_delete, aborting." 0
|
||||
break
|
||||
}
|
||||
if {[safe_delete $file]} {
|
||||
log " EXPIRE: removed $file" 0
|
||||
}
|
||||
::auto::recalcdir $dir
|
||||
incr num -1
|
||||
}
|
||||
|
|
|
@ -28,6 +28,8 @@ if {![exists -proc _del_bindir]} {
|
|||
proc safe_delete {file {px ""}} {
|
||||
global _del_dustbin
|
||||
|
||||
if {![file exists $file]} return 1
|
||||
|
||||
# Check if undelete is installed and that the file being
|
||||
# deleted is not already in the dustbin.
|
||||
set dustbin 1
|
||||
|
|
|
@ -61,7 +61,8 @@ ts method size {} {
|
|||
ts method _parse {line} {
|
||||
set vars [split $line "\t"]
|
||||
|
||||
lassign [split $line "\t"] \
|
||||
if {[llength $vars] >= 18} {
|
||||
lassign $vars \
|
||||
title synopsis definition channel_num channel_name \
|
||||
start end flags_list guidance bookmarks schedstart scheddur \
|
||||
genre resume status seriesnum episodenum episodetot
|
||||
|
@ -69,6 +70,7 @@ ts method _parse {line} {
|
|||
set synopsis [xconv $synopsis]
|
||||
|
||||
set flags [split [string range $flags_list 0 end-1] ,]
|
||||
}
|
||||
}
|
||||
|
||||
ts method lastmod {} {
|
||||
|
|
Loading…
Reference in New Issue