improve bfolder to follow links

This commit is contained in:
hummypkg 2017-05-27 09:38:58 +00:00
parent 2cb9e076a6
commit 64333df82e
2 changed files with 8 additions and 2 deletions

View File

@ -1,7 +1,7 @@
Package: sweeper
Priority: optional
Section: misc
Version: 2.1.5-6
Version: 2.1.5-7
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif(>=1.4.0)

View File

@ -230,7 +230,7 @@ proc ::sweeper::expand {ts str {orig ""}} {
"%filename" [$ts get file] \
"%basename" [$ts bfile] \
"%folder" [$ts dir] \
"%bfolder" [string map [list "$::auto::root/" ""] [$ts dir]] \
"%bfolder" [relativedir [$ts dir]] \
\
%epname [$ts episode_name] \
%series [$ts get seriesnum] \
@ -289,6 +289,12 @@ proc ::sweeper::resolvedir {dir} {
return "$::auto::root/$dir"
}
proc ::sweeper::relativedir {dir} {
return [string map \
[list "[file normalize $::auto::root]/" ""] \
[file normalize $dir]]
}
# returns true if the arguments are actually the same file
proc ::sweeper::samefile {a b} {
if {![file exists $a] || ![file exists $b]} { return 0 }