+ thumbnail) if [ -f "$_DATA/$PATH_INFO" ]; then
+ . "$_EXEC/cgilite/file.sh"
+ index="$_DATA/${PATH_INFO%/*}/.index"
+ thumb="$index/${PATH_INFO##*/}"; thumb="${thumb%.*}.jpg"
+ if [ -d "$index" -a ! -f "$thumb" ] && { printf %s "$PATH_INFO" |grep -qE -e "${file_pattern}" ;}; then
+ . "$_EXEC/thumbnail.sh"
+ gen_thumb "$_DATA/$PATH_INFO" "$thumb"
+ fi
+ FILE "$thumb"
+ return 0
+ fi;;
+ download) if [ -f "$_DATA/$PATH_INFO" ]; then
+ . "$_EXEC/cgilite/file.sh"
+ fakemp4="$(COOKIE fakemp4)"
+ downscale="$(COOKIE downscale)"
+ downfile="$_DATA/${PATH_INFO%/*}/.transcode/${PATH_INFO%.*}.480p.webm"
+ if [ "$downscale" = yes -a -f "$downfile" ]; then
+ FILE "$downfile" "$([ "$fakemp4" = yes ] && printf 'video/mp4')"
+ else
+ FILE "$_DATA/$PATH_INFO" "$([ "$fakemp4" = yes ] && printf 'video/mp4')"
+ fi
+ return 0
+ fi;;
+ delete) if [ -f "$_DATA/$PATH_INFO" ]; then
+ :
+ fi;;
+ advsearch) if [ -d "$_DATA/$PATH_INFO" ]; then
+ . "$_EXEC/advsearch.sh"
+ return 0
+ fi;;
+ spawnindex) if [ -d "$_DATA/$PATH_INFO" ]; then
+ if [ "$(POST recursive)" = yes ]; then
+ find "$_DATA/$PATH_INFO" -depth -type d \! -name .index \
+ -exec mkdir -p '{}'/.index \;
+ else
+ mkdir -p "$_DATA/$PATH_INFO/.index"
+ fi
+ REDIRECT "$(POST ref)"
+ fi;;