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