#!/bin/zsh
-# Copyright 2014 2016 Paul Hänsch
+# Copyright 2014, 2016 Paul Hänsch
#
# This file is part of Serve0.
#
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)