diff --git a/CONTROL/control b/CONTROL/control index 7ab49b8..3cf09ec 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,9 +1,9 @@ Package: sweeper Priority: optional Section: misc -Version: 2.0.2 +Version: 2.0.3 Architecture: mipsel Maintainer: af123@hummypkg.org.uk -Depends: webif(>=1.0.14-10) -Description: Sweeper is a package for managing recordings in a variety of ways using custom rules [Add and/or clauses. See forum.] +Depends: webif(>=1.0.15-3) +Description: Sweeper is a package for managing recordings in a variety of ways using custom rules [See forum for details] Tags: http://hummy.tv/forum/threads/5138/ diff --git a/webif/plugin/sweeper/auto.hook b/webif/plugin/sweeper/auto.hook index 0584bd6..2af0d5e 100644 --- a/webif/plugin/sweeper/auto.hook +++ b/webif/plugin/sweeper/auto.hook @@ -410,7 +410,7 @@ proc ::sweeper::action_fileunder {ts cmd arg folder} { return 1 } set folder [$ts dir] - set lfolder [file tail $folder]] + set lfolder [file tail $folder] log " - searching for $lfolder under $dir" 2 set target [::sweeper::find $dir $lfolder $folder] @@ -444,18 +444,23 @@ proc ::sweeper::action_fileunder {ts cmd arg folder} { alias ::sweeper::action_fileundercreate ::sweeper::action_fileunder proc ::sweeper::action_renamefile {ts cmd arg folder} { + set dir [$ts dir] if {$folder} { - ::sweeper::folder_apply [$ts dir] \ + ::sweeper::folder_apply $dir \ ::sweeper::action_renamefile $cmd $arg 0 return 0 } set arg [system filename [::sweeper::expand $ts $arg [$ts bfile]]] set file [$ts get file] log "Renaming $file to $arg" 0 - if {[file exists "[$ts dir]/$arg.ts"]} { + if {[file exists "$dir/$arg.ts"]} { log "... ERROR Target already exists" 0 return 0 } + if {[::sweeper::samefile $file "$dir/$arg.ts"]} { + log "... ERROR Target is the same as source" 0 + return 0 + } if {!$::sweeper::dryrun} { ts renamegroup $file $arg if {[file exists "$dir/$arg.ts"]} { diff --git a/webif/plugin/sweeper/schema.js b/webif/plugin/sweeper/schema.js index 8ab95ae..66f4c1b 100644 --- a/webif/plugin/sweeper/schema.js +++ b/webif/plugin/sweeper/schema.js @@ -1,12 +1,5 @@ var schema = { criterion: { - lastrule: { - 'class': 'all', - type: 'noarg', - desc: 'Last Rule Matched', - negate: true, - def: "" - }, lcn: { 'class': 'all', type: 'int', @@ -162,6 +155,14 @@ var schema = { negate: true, def: 'Enter text here...' }, + lastrule: { + 'class': 'all', + type: 'noarg', + desc: 'Previous Rule Matched', + idesc: "Previous Rule didn't match", + negate: true, + def: "" + }, 'or': { 'class': 'all', type: 'composite',