]> git.plutz.net Git - serve0/blob - pages/view.sh
transmit file name correctly for meta edit
[serve0] / pages / view.sh
1 #!/bin/zsh
2
3 # Copyright 2014, 2015 Paul Hänsch
4 #
5 # This file is part of Serve0.
6
7 # Serve0 is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 # Serve0 is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU Affero General Public License for more details.
16
17 # You should have received a copy of the GNU Affero General Public License
18 # along with Serve0.  If not, see <http://www.gnu.org/licenses/>. 
19
20 info="$_GET[\"i\"]"
21 . $_EXEC/pages/common.sh
22
23 meta="${_DATA}/meta/$info.meta"
24 video="${_DATA}/videos/$info"
25 tags="$(sed -n '2p' "$meta")"
26 description="$(sed -n '3,$p' "$meta")"
27 length=0; width=0; height=0;
28 eval $(mplayer -noconsolecontrols -input file=/dev/null -slave -really-quiet -identify -frames 0 -ao null -vo null "$video" 2>/dev/null\
29 | sed -rn 's:ID_VIDEO_WIDTH=(.*):width=\1:p;s:ID_VIDEO_HEIGHT=(.*):height=\1:p;s:ID_LENGTH=(.*)(\..*)$:length=\1:p;')
30 video="videos/$info"
31
32 case "$1" in
33   title)
34     echo "Videos"
35   ;;
36   css)
37     . ${_EXEC}/templates/common.css.sh
38   ;;
39   body)
40     . ${_EXEC}/templates/view.html.sh
41   ;;
42 esac