]> git.plutz.net Git - serve0/commitdiff
show group listings in video view
authorPaul Hänsch <paul@plutz.net>
Tue, 21 Dec 2021 20:00:21 +0000 (21:00 +0100)
committerPaul Hänsch <paul@plutz.net>
Tue, 21 Dec 2021 20:00:21 +0000 (21:00 +0100)
style.css
view.sh

index 391a6da809032322ba5786167043b0ce22920190..7f6f2bbf46b9918a1c9ba365a8770475babd33da 100644 (file)
--- a/style.css
+++ b/style.css
@@ -277,6 +277,10 @@ body#view .tag {
   border-radius: 1pt;
 }
 
+body#view .itemlist {
+  margin-top: 2em;
+}
+
 
 /* ====== SCALE BLOCK ELEMENTS ====== */
 
diff --git a/view.sh b/view.sh
index 094337ea15d99ea3c1cff1a86b34fd0f24658a94..1566a82f208644a2fda1766311069eed721d10a7 100755 (executable)
--- a/view.sh
+++ b/view.sh
@@ -36,6 +36,31 @@ printf 'Content-Type: text/html;charset=utf-8\r\n\r\n'
   printf %s\\n "$META_TAGS" |tr , \\n |while read tag; do
     [ "$tag" ] && printf '  [span .tag . %s]\n' "$(HTML "${tag#-}")"
   done
+
+  if [ "${META_GROUP}" ]; then
+    printf '[div .itemlist'
+    list_meta "$_DATA/${ITEM%/*}/.index/meta" \
+    | grep -F "${CR}   ${META_GROUP}" \
+    | while read_meta; do
+      file="$(printf %s\\n "$_DATA/${META_NAME}".*)"
+      [ "/${file#${_DATA}/}" = "$ITEM" ] && continue
+      name="$(HTML "/${file#${_DATA}/}")"
+
+      printf '[div .list .file
+                [a href="%s" [img src="%s?a=thumbnail"]][label . %s]
+                [span .time %i:%02imin] [span .dim %ix%i] %s
+              ]' \
+        "$name" "$name" "${name##/}" \
+        "$((META_LENGTH / 60))" "$((META_LENGTH % 60))" \
+        "$META_WIDTH" "$META_HEIGHT" \
+        "$(printf %s\\n "${META_TAGS}" \
+           | sed -r 's;^;,;; s;,+;,;g; s;,$;;;
+                     :X s;,-?([^,]+)(,|$); [span .tag\n \1]\2;; tX;'
+        )"
+    done
+    printf ']'
+  fi
+
   printf '
   [div #editing
     [form method=POST action="/?a=multitag"