]> git.plutz.net Git - serve0/blobdiff - list.sh
further increase thumbnail quality (though still using jpeg ;-)
[serve0] / list.sh
diff --git a/list.sh b/list.sh
index e8b7075f1f889ac3c4527dab07d9e475b4d005d9..18799f3ec3af2f77442224ca7191d62aeca1d88f 100644 (file)
--- a/list.sh
+++ b/list.sh
@@ -17,7 +17,7 @@ list_item() {
        $(meta_info "$_DATA/$ITEM/$1")
        EOF
     printf '[div .list .file
-              [a href="%s" [img src="%s?a=thumbnail"][label %s]]
+              [a href="%s" [img src="%s?a=thumbnail"]][label %s]
               [span .time %i:%imin] [span .dim %ix%i] %s
               [checkbox "select" "%s" id="select_%s"][label for="select_%s" +]
             ]' \
@@ -77,9 +77,12 @@ list_filemeta(){
   | if [ "$FILTER" ]; then
     sed -nr "$list_fex"
   elif [ "${SEARCH#!}" != "${SEARCH}" ]; then
-    grep -aviE "$(STRING "${SEARCH#!}" |sed -r 's;((^|[^\\])(\\\\)*)\+;\1\\+;g;')"
+    grep -aviE "$(STRING "${SEARCH#!}" |sed -r ':x s;((^|[^\\])(\\\\)*)\+;\1\\+;g; tx;')"
   else
-    grep -aiE "$(STRING "${SEARCH}" |sed -r 's;((^|[^\\])(\\\\)*)\+;\1\\+;g;')"
+    grep -aiE "$(STRING "${SEARCH}" \
+                 | sed -r ':x s;((^|[^\\])(\\\\)*)\+;\1 ;g; tx;
+                            s;((^|[^\\])(\\\\)*)\\\+;\1+;g;
+                            s; ;\\+;g;')"
   fi |cut -f6 | UNSTRING \
   | while read -r fn; do
     printf '%s\n' "${base}/${fn%${CR}}"
@@ -90,7 +93,7 @@ list_index(){
   local meta
   (cd "$_DATA/$ITEM";
     find ./ -path '*/.index/meta'
-  ) | while meta="$(line)"; do
+  ) | while read -r meta; do
     list_filemeta "${meta%/.index/meta}"
   done
 }
@@ -159,8 +162,9 @@ printf 'Content-Type: text/html;charset=utf-8\r\n\r\n'
     [a #t_avsearch href="#advsearch" Advanced]
     [a #t_prefs href="#prefs" ⚙]
   ]'
-  w_prefs
+  w_bookmarks
   w_advsearch
+  w_prefs
   printf '
   [form method=POST action="?a=multitag"'
     list_items \