]> git.plutz.net Git - serve0/commitdiff
avoid filtering with empty filters
authorpaul <paul@plutz.net>
Sat, 15 Aug 2015 19:10:30 +0000 (19:10 +0000)
committerpaul <paul@plutz.net>
Sat, 15 Aug 2015 19:10:30 +0000 (19:10 +0000)
svn path=/trunk/; revision=82

pages/common.sh

index cf054910b384245ec03eed2d6914f2bc13f63030..e03e6f5da8e5e9c7e2f413594713f7f82c448f2c 100755 (executable)
@@ -112,13 +112,16 @@ thumblist() {
       
     genlist \
     | if [ -n "$search" ] ; then
+      debug "Applying search: ${search}"
       xargs -d '\n' printf "${_DATA}/meta/%s.meta\n" \
       | xargs -d '\n' egrep -sil "$search" \
       | sed -r 's;^.*/;;;s;\.meta$;;'
-    elif [ "$filterex" != "q0" ]; then
+    elif [ -n "$filter" ]; then
+      debug "Applying filters: ${filter} ++ ${filterex}"
       xargs -d '\n' printf "${_DATA}/meta/%s.meta\n" \
       | xargs -d '\n' sed -srn ":a;N;2!ba;{${filterex}}"
     else
+      debug "No search or filtering"
       cat
     fi \
     | sed -n "$page,$(($page + $pagesize - 1))p" \