From 885db239e7dbba3007e8f2827671b9a6095eadaf Mon Sep 17 00:00:00 2001 From: hummypkg Date: Tue, 3 May 2016 20:59:16 +0000 Subject: [PATCH] 2.1.0 with recurse rules --- CONTROL/control | 4 +-- webif/plugin/sweeper/auto.hook | 27 ++++++++++++++++--- webif/plugin/sweeper/edit.jim | 12 ++++----- webif/plugin/sweeper/harness.jim | 16 +++++++++-- webif/plugin/sweeper/img/delete.png | Bin 0 -> 431 bytes webif/plugin/sweeper/img/down.png | Bin 0 -> 300 bytes webif/plugin/sweeper/img/edit.png | Bin 0 -> 814 bytes webif/plugin/sweeper/img/page_white_copy.png | Bin 0 -> 309 bytes webif/plugin/sweeper/img/up.png | Bin 0 -> 300 bytes webif/plugin/sweeper/th/expand | 4 +-- 10 files changed, 47 insertions(+), 16 deletions(-) create mode 100644 webif/plugin/sweeper/img/delete.png create mode 100644 webif/plugin/sweeper/img/down.png create mode 100644 webif/plugin/sweeper/img/edit.png create mode 100644 webif/plugin/sweeper/img/page_white_copy.png create mode 100644 webif/plugin/sweeper/img/up.png diff --git a/CONTROL/control b/CONTROL/control index b726daa..5a1b90d 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,9 +1,9 @@ Package: sweeper Priority: optional Section: misc -Version: 2.0.17 +Version: 2.1.0 Architecture: mipsel Maintainer: af123@hummypkg.org.uk -Depends: webif(>=1.2.5-10) +Depends: webif(>=1.3.0-1) 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 455cfd0..c5b52d7 100644 --- a/webif/plugin/sweeper/auto.hook +++ b/webif/plugin/sweeper/auto.hook @@ -985,7 +985,7 @@ proc ::sweeper::apply_folder_rules {dir rules} { } } -proc ::sweeper::apply_rules {dir rules {depth 0}} { +proc ::sweeper::apply_rules {dir rules {depth 0} {seen {}}} { log "" 2 log "--- SWEEP($depth) STARTING FOR $dir ---" 2 @@ -996,7 +996,14 @@ proc ::sweeper::apply_rules {dir rules {depth 0}} { return } - set moredepth 0 + file stat $dir st + set key "$st(dev):$st(ino)" + if {$key in $seen} { + log "Already seen $dir ($key)" 2 + return + } + lappend seen $key + set dirs {} foreach e [readdir -nocomplain $dir] { set entry "$dir/$e" @@ -1031,16 +1038,28 @@ proc ::sweeper::apply_rules {dir rules {depth 0}} { if {[llength $rule] < 3} continue set rule [lassign $rule level] if {$level < $depth} continue - if {$level > $depth} { incr moredepth } if {[::sweeper::runrule $ts $rule 0]} break } } + set moredepth 0 + foreach rule $rules { + set level [lindex $rule 0] + if {$level > $depth} { + incr moredepth + break + } + } + # No rules require greater recursion if {!$moredepth} return foreach dir $dirs { - ::sweeper::apply_rules $dir $rules $($depth + 1) + ::sweeper::apply_rules $dir $rules $($depth + 1) $seen + + file stat $dir st + set key "$st(dev):$st(ino)" + lappend seen $key } } diff --git a/webif/plugin/sweeper/edit.jim b/webif/plugin/sweeper/edit.jim index f8c9096..977e48f 100755 --- a/webif/plugin/sweeper/edit.jim +++ b/webif/plugin/sweeper/edit.jim @@ -66,7 +66,7 @@ Add pre-defined ruleset: Unnamed rule - + @@ -78,19 +78,19 @@ Add pre-defined ruleset: title="Enable/Disable Rule"> - - - - @@ -100,7 +100,7 @@ Add pre-defined ruleset: fi&SPz~8F&Vk~xHPSBL-i}kmSOjZsDs=?gA5`9dz+Oc~F@#6P{lw?p z)$jU_Bz>=&7hM|~XQdT3`_z-wUba(3ZaprqzgDxAyXWM0H?^wEt@qlq7nXNjJZcp= z&qAhONkGqRn%%T?Uc3KSWaD$f`FghgZ%glq*}3rC2k(zLcTeW;o%#3QEji7Ja+=Y< z1+DJ?;n&ZLYPTd8X*B1YZ9Y`^j1o;IsI6S+N2I3@nySp%Su*!M>Ih+L^k;M!Q+`=Ht z$S`Y;1W=H@#M9T6{R)qWpnOV@SoV`9-rk8JWuL`-h5&}Ni7d+(Y?#2n&CM+w!`t4_z#t^Aa!9-7OnO4X mlShsZnXhi}UQo@x+?`SDIqMu#L4|mrEexKnelF{r5}E+?zhWx@ literal 0 HcmV?d00001 diff --git a/webif/plugin/sweeper/img/edit.png b/webif/plugin/sweeper/img/edit.png new file mode 100644 index 0000000000000000000000000000000000000000..e7e1851ce5e580a386d9e38cba1af559f84264d3 GIT binary patch literal 814 zcmV+}1JV46P)^1rYJ?J$S{X!%NaOR z$*CooCYmW0lnU}92%#|)c?l6TK)8B*)LL2hc7Hj~&hNg?b50C}DF2W+7BLCbNZi3y zUhKXf#L~{S_03xGtWd&UA7#(3c*=pqc*>4AiZAWZ?g;r^Rh1uWX{tEl?U%yy{pAc{?NrJ@%e{oY=d4#vrB@*q=E2x;8Lpu-m{yj+ z<*{Np3TEtn4g zQ=TYBtt;rz1;F6`1#BSun@dxkb>%0K$kGO4B93F7{|eg@FtZ3~ol#ul>2RJs@jJn0 zlGHn5`pv@o=q^geoa88i>H@fRA zus9}wd9)fbSt~x8-Q;xjLKGS0+CTrnW`ZjXGxXecJ2*XN6h9TARdO3I9-alin1Od= zT1*g|KiMO=RHjD?OT9HgPK%vhNxVF{H3X4r0e3sqU^NVb`%($HX_4GKVv8W1ZNSNV z&A)+L%{JtTt;lJ#B1>onlWzjEN)KkG7MT@VFgONc`s9Cs?Ki};v@Fpy*-U|vmQgW9 sV{j*F=ZeQ^#NE?QvD7qT`dY{Q1d#d@seb#jPyhe`07*qoM6N<$f)GG)O8@`> literal 0 HcmV?d00001 diff --git a/webif/plugin/sweeper/img/page_white_copy.png b/webif/plugin/sweeper/img/page_white_copy.png new file mode 100644 index 0000000000000000000000000000000000000000..a9f31a278e17993d8d4e13beac2f9d5f7b42d08f GIT binary patch literal 309 zcmV-50m}Y~P)-^wyCpkB?q`0y24p-YX!*SQ6wH%;50sMjD8d z{Pxn5I+pC1pr9}9Vj#fIz;~AQTHV@rML;VUJYD@<);T3K0RUQ#VRirj literal 0 HcmV?d00001 diff --git a/webif/plugin/sweeper/th/expand b/webif/plugin/sweeper/th/expand index b7be34a..b056623 100755 --- a/webif/plugin/sweeper/th/expand +++ b/webif/plugin/sweeper/th/expand @@ -19,7 +19,7 @@ foreach {test expected} { {/mod/video/%asfilename:bob/fred:.ts} {/mod/video/bob_fred.ts} {/mod/video/%asfilename:bob/fred:.ts%replace:video:radiator:} {/mod/radiator/bob_fred.ts} {%epname} {6/10. The Fame Game} - {%epdescr} {s?e6/10} + {%epdescr} {s?e06/10} {%synopsis%regsub,Game:\s*,,} {6/10. The Fame Crime drama. While Sasha is occupied with an intensive training course, the boys' investigations take them to a lookalike agency. [HD] [AD,S]} {Z Nation_ 20150825_2200.ts%regsub,_ \s*, - ,} {Z Nation - 20150825_2200.ts} {%synopsis%regsub:^\s*([^ ]+)\s+([^ ]+).*:\1,\2:} {6/10.,The} @@ -30,7 +30,7 @@ foreach {test expected} { puts [format "%-70s => OK" $test] } else { puts [format "%-70s => FAIL" $test] - puts " $ret" + puts " ($ret)/($expected)" } }