]> git.plutz.net Git - serve0/commitdiff
improved time formatting
authorPaul Hänsch <paul@plutz.net>
Tue, 28 Aug 2018 16:46:44 +0000 (18:46 +0200)
committerPaul Hänsch <paul@plutz.net>
Tue, 28 Aug 2018 16:46:44 +0000 (18:46 +0200)
list.sh
view.sh

diff --git a/list.sh b/list.sh
index f36fe67fe13fa969677195f9152b225fcb1cdf6b..a408af9b33567c3be511d6fab8659b1c600d3e35 100644 (file)
--- a/list.sh
+++ b/list.sh
@@ -29,7 +29,7 @@ list_item() {
     name="$(HTML "$ITEM/$name")"
     printf '[div .list .file
               [a href="%s" [img src="%s?a=thumbnail"]][label %s]
-              [span .time %i:%imin] [span .dim %ix%i] %s
+              [span .time %i:%02imin] [span .dim %ix%i] %s
               [checkbox "select" "%s" id="select_%s"][label for="select_%s" +]
             ]' \
       "$link" "$link" "${name##*&#47;}" \
diff --git a/view.sh b/view.sh
index 8854c4801e558939bb64447086c68d09952b32c6..c08be24fa1a662a98bcb2bd88b3e4e01f03e0185 100644 (file)
--- a/view.sh
+++ b/view.sh
@@ -32,7 +32,7 @@ printf 'Content-Type: text/html;charset=utf-8\r\n\r\n'
   [a "javascript:stereoview(180, document.getElementById(&#34;mainvideo&#34;));" View 180° Stereoscopic]
   [a "javascript:stereoview(360, document.getElementById(&#34;mainvideo&#34;));" View 360° Stereoscopic]
   [video #mainvideo controls="controls" [source src="?a=download" type="video/mp4"]]
-  [span .time %i:%imin] [span .dim %ix%i] %s
+  [span .time %i:%02imin] [span .dim %ix%i] %s
   ' "$(HTML "${ITEM##*/}" |sed -r "$w_ascii"' s;[^0-9a-zA-Z&#];&[wbr];g')" \
     "$((length / 60))" "$((length % 60))" "$width" "$height" \
     "$(printf '%s\n' "${tags#tags=}" |sed -r "$UNSTRING"'