diff --git a/CONTROL/control b/CONTROL/control index 4be9aed..5398374 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -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) diff --git a/webif/plugin/sweeper/auto.hook b/webif/plugin/sweeper/auto.hook index 5a6dd30..6832114 100644 --- a/webif/plugin/sweeper/auto.hook +++ b/webif/plugin/sweeper/auto.hook @@ -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 }