+ delete)
+ if [ ! "$USER_ID" ]; then
+ REDIRECT "${_BASE}/channel/${channel}/${video}/#ERROR_NOTLOGGEDIN"
+ elif ! AUTHOR; then
+ REDIRECT "${_BASE}/channel/${channel}/${video}/#ERROR_UPDATE_NOTALLOWED"
+ elif [ "$(POST delconfirm)" != confirm ]; then
+ REDIRECT "${_BASE}/channel/${channel}/${video}/#ERROR_NOT_CONFIRMED"
+ elif LOCK "$vid_db"; then
+ while read -r id tail; do
+ [ "$id" != "$video" ] && printf '%s %s\n' "$id" "$tail"
+ done <"$vid_db" >"${vid_db}.$$"
+ mv -- "${vid_db}.$$" "$vid_db"
+ rm -- "${_DATA}/${channel}/${video}.mp4" "${_DATA}/${channel}/${video}_thumb.jpg"
+ RELEASE "$vid_db"
+ REDIRECT "${_BASE}/channel/${channel}/#DELETE_CONFIRM"
+ else
+ REDIRECT "${_BASE}/channel/${channel}/${video}/#ERROR_UPDATE_NOLOCK"
+ fi
+ ;;