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"
28 length="${_POST[length]}"
29 width="${_POST[width]}"
30 height="${_POST[height]}"
31 trash="${_POST[trash]}"
32 cancel="${_POST[cancel]}"
33 tagacc="${_POST[tag]}"
34 tags="$(htmlsafe "${_POST[tags]}" |sed -r 's:\t: :g;s:^!|[\r\$\^\|]::g;' |tr '\n' '|')"
35 description="$(htmlsafe "${_POST[description]}")"
37 n=0; while [ -n "${_POST[tag$n]}" ]; do
38 tagacc="$(htmlsafe ${_POST[tag$n]} |sed -r '2,$d;s:\t| :_:g;s:^!|\r|\$|\^::g;')|$tagacc"
42 [ -z "$cancel" -a -n "$info" ] && if [ -n "$trash" ]; then
43 rm "${_DATA}/thumbs/$info.jpg" 2>/dev/null
44 mv "${_DATA}/videos/$info" "${_DATA}/meta/$info.meta" "${_DATA}/trash/" 2>/dev/null
45 rm "${_DATA}/cache/$info.cache" 2>/dev/null
46 rm ${_DATA}/cache/\?* 2>/dev/null
49 ${length} ${width} ${height} ${info}
53 rm "${_DATA}/cache/$info.cache" 2>/dev/null
54 rm ${_DATA}/cache/\?* 2>/dev/null
55 rm ${_DATA}/cache/taglist_set ${_DATA}/cache/taglist_filter 2>/dev/null
58 redirect "${_POST[referrer]:-?i=&pn=${page}&s=${search}&f=${filter}&o=${order}#${info}}"