]> git.plutz.net Git - serve0/commitdiff
list alternative file types in group view
authorPaul Hänsch <paul@plutz.net>
Sun, 7 Jan 2024 02:16:31 +0000 (03:16 +0100)
committerPaul Hänsch <paul@plutz.net>
Sun, 7 Jan 2024 02:16:31 +0000 (03:16 +0100)
view.sh

diff --git a/view.sh b/view.sh
index 5263e2c59d84a10dc27949262739d52d5513b3e0..7c73592bb71bd43c77b5b4a0b7502c9b57b1dcbc 100755 (executable)
--- a/view.sh
+++ b/view.sh
@@ -30,8 +30,10 @@ printf 'Content-Type: text/html;charset=utf-8\r\n\r\n'
          [input type=hidden id=StereoDist name=StereoDist value="$(COOKIE StereoDist |grep -xE '[0-9]+' || printf 32)"]
          [video #mainvideo controls="controls" preload="auto" [source src="?a=download" type="video/mp4"]]
          [a "?a=download" Download]
-         [a "javascript:stereoview(180, document.getElementById(&#34;mainvideo&#34;));" View 180° Stereoscopic]
-         [a "javascript:stereoview(360, document.getElementById(&#34;mainvideo&#34;));" View 360° Stereoscopic]
+         [label Stereoscopic View:]
+         [a "javascript:stereoview('sbs180', document.getElementById(&#34;mainvideo&#34;));" SBS 180°]
+         [a "javascript:stereoview( 'tb360', document.getElementById(&#34;mainvideo&#34;));" Top/Bottom 360°]
+         [a "javascript:stereoview( 'cu360', document.getElementById(&#34;mainvideo&#34;));" Cubic 360°]
          [h1 . $(HTML "${ITEM##*/}" |sed -E 's;[^0-9a-zA-Z&#];&[wbr];g')]
          [span .time $((META_LENGTH / 60)):$(printf %02i $((META_LENGTH % 60)))min] [span .dim ${META_WIDTH}x${META_HEIGHT}]
        EOF
@@ -44,8 +46,7 @@ printf 'Content-Type: text/html;charset=utf-8\r\n\r\n'
     list_meta "$_DATA/${ITEM%/*}/.index/meta" \
     | grep -F "${CR}   ${META_GROUP}" \
     | sort -n -k8 -k6,6 \
-    | while read_meta; do
-      file="$(printf %s\\n "$_DATA/${META_NAME}".*)"
+    | while read_meta; do for file in "$_DATA/${META_NAME}".*; do
       [ "/${file#${_DATA}/}" = "$ITEM" ] && continue
       name="$(HTML "/${file#${_DATA}/}")"
 
@@ -60,7 +61,7 @@ printf 'Content-Type: text/html;charset=utf-8\r\n\r\n'
            | sed -r 's;^;,;; s;,+;,;g; s;,$;;;
                      :X s;,-?([^,]+)(,|$); [span .tag\n \1]\2;; tX;'
         )"
-    done
+    done; done
     printf ']'
   fi