From: paul Date: Wed, 4 May 2016 10:12:20 +0000 (+0000) Subject: show time in progress bar X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=502526f13e9ac1a758ae7defedbbe620d893649d;p=serve0 show time in progress bar svn path=/trunk/; revision=125 --- diff --git a/pages/playctl.sh b/pages/playctl.sh index c4ece2c..1150780 100755 --- a/pages/playctl.sh +++ b/pages/playctl.sh @@ -47,10 +47,10 @@ progress(){ | tr '\r' '\n' \ | sed -urn '1~5s;^.* V: +([0-9]+)(\.[0-9]+) A-V:.*$;\1;p' \ | while read m; do - printf "%s\n" "$(($m * 100 / $length))" + printf "%d %d:%02d\n" "$(($m * 100 / $length))" "$(($m / 60))" "$(($m % 60))" done \ | while read n; do [ "$n" != "$previous" ] && printf "%s\n" "$n" - previous=$n + previous="$n" done } diff --git a/templates/playctl.html.sh b/templates/playctl.html.sh index 6f435e7..62fe1d2 100755 --- a/templates/playctl.html.sh +++ b/templates/playctl.html.sh @@ -103,8 +103,8 @@ EOF cnt=0 progress \ -| while read n; do - printf '%s\n' $n $n +| while read p t; do + printf '%s\n' "${p}" "${t}" done # vi:set filetype=html: