2 # Copyright 2014 - 2016 Paul Hänsch
4 # This file is part of Serve0
6 # Serve0 is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU Affero General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # Serve0 is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU Affero General Public License for more details.
16 # You should have received a copy of the GNU Affero General Public License
17 # along with Serve0 If not, see <http://www.gnu.org/licenses/>.
21 info="${_GET[i]:-$_REF[i]}"
26 file="${_DATA}/meta/$info.meta"
29 length="${_POST[length]}"
30 width="${_POST[width]}"
31 height="${_POST[height]}"
32 trash="${_POST[trash]}"
33 cancel="${_POST[cancel]}"
34 tagacc="${_POST[tag]}"
35 tags="$(htmlsafe "${_POST[tags]}" |sed -r 's:\t: :g;s:^!|[\r\$\^\|]::g;' |tr '\n' '|')"
36 description="$(htmlsafe "${_POST[description]}")"
38 n=0; while [ -n "${_POST[tag$n]}" ]; do
39 tagacc="$(htmlsafe ${_POST[tag$n]} |sed -r '2,$d;s:\t| :_:g;s:^!|\r|\$|\^::g;')|$tagacc"
43 [ -z "$cancel" -a -n "$info" ] && if [ -n "$trash" ]; then
44 rm "${_DATA}/thumbs/$info.jpg" 2>/dev/null
45 mv "${_DATA}/videos/$info" "${_DATA}/meta/$info.meta" "${_DATA}/trash/" 2>/dev/null
46 rm "${_DATA}/cache/$info.cache" 2>/dev/null
47 rm ${_DATA}/cache/\?* 2>/dev/null
50 ${length} ${width} ${height} ${info}
54 rm "${_DATA}/cache/$info.cache" 2>/dev/null
55 rm ${_DATA}/cache/*[0-9]\?* 2>/dev/null
56 rm ${_DATA}/cache/taglist 2>/dev/null
59 redirect "?i=&pn=${page}&s=${search}&f=${filter}&o=${order}#${info}"