X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=pages%2Fview.sh;h=fef4f780a8066c5d203df769748b4aead5cc8bf5;hb=699ce04d08d429ef5a7dbda90134965927588a5e;hp=97b8e37ea672b98e18e69666e47cdf59e8402895;hpb=47b905d14103c01625d16fe557e63e34317c6453;p=serve0 diff --git a/pages/view.sh b/pages/view.sh index 97b8e37..fef4f78 100755 --- a/pages/view.sh +++ b/pages/view.sh @@ -1,6 +1,6 @@ #!/bin/zsh -# Copyright 2014, 2015 Paul Hänsch +# Copyright 2014 2016 Paul Hänsch # # This file is part of Serve0. # @@ -17,13 +17,14 @@ # You should have received a copy of the GNU Affero General Public License # along with Serve0. If not, see . -. $_EXEC/pages/list.sh -. $_EXEC/pages/tree.sh +. $_EXEC/pages/common.sh info="${_GET[i]}" location="$(invalidate "${_GET[l]}" '(.*/)?\.\.(/.*)?|' /)" directory="${location%/*}" +TITLE="$info" + meta="${_DATA}/meta/$info.meta" [ -n "$info" ] && video="${_DATA}/videos/$info" \ || video="${treeroot%/}/${location#/}" @@ -32,7 +33,7 @@ description="$(sed -n '3,$p' "$meta")" length=0; width=0; height=0; debug "Analysing video: $video" -echo '' |mplayer -input nodefault-bindings -nosound -vo null -identify -frames 0 "$video" \ +printf '' |mplayer -input nodefault-bindings -nosound -vo null -identify -frames 0 "$video" \ | sort \ | sed -rn 's:ID_LENGTH=(.*)(\..*)$:\1:p; s:ID_VIDEO_HEIGHT=(.*):\1:p;