]> git.plutz.net Git - serve0/blobdiff - pages/playctl.sh
time display for files from directory
[serve0] / pages / playctl.sh
index 11507803019f8d916d1e500ce772bc5b91dade49..e273237b48666c676e56eea4fbb954fe2b94dc7e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/zsh
 
-# Copyright 2014 2016 Paul Hänsch
+# Copyright 2014, 2016 Paul Hänsch
 #
 # This file is part of Serve0.
 # 
@@ -24,19 +24,13 @@ location="$(invalidate "${_GET[l]}" '(.*/)?\.\.(/.*)?|' /)"
 directory="${location%/*}"
 statusfile="$_DATA/mplayer.status"
 
-TITLE="$info"
-
-if [ -n "$info" ]; then
-  video="${_DATA}/videos/$info"
-  meta="${_DATA}/meta/$info.meta"
-  tags="$(sed -n '2p' "$meta")"
-  description="$(sed -n '3,$p' "$meta")"
-  head -n1 "$meta" |read length width height x
-else
-  video="${treeroot%/}/${location#/}"
-  meta=''; tags=''; length=0; width=0; height=0;
-  description=0
-fi
+[ -n "$info" ] && video="${_DATA}/videos/$info" \
+               || video="${treeroot%/}/${location#/}"
+
+meta="${_DATA}/mplayer.meta"
+tags="$(sed -n '2p' "$meta")"
+description="$(sed -n '3,$p' "$meta")"
+head -n1 "$meta" |read length width height TITLE
 
 volume=$(validate "$(cat "$_DATA/mplayer.volume")" '[1-9]?[0-9]|100' 20)