X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=index.cgi;h=4d7e8aa6fc045cdd1f49a29637d8b664917b3df4;hb=cdb3e3cbc4b7b2009d88833b3a802e73c0213f4c;hp=6b0dc549d6676f53491e28adca926666e008e4f3;hpb=e00c626003d48bbf2d41619ee5379e95dc43fa27;p=serve0 diff --git a/index.cgi b/index.cgi index 6b0dc54..4d7e8aa 100755 --- a/index.cgi +++ b/index.cgi @@ -42,30 +42,38 @@ case $ACTION in fi REDIRECT "$(POST ref)" ;; + multitag) + . "$_EXEC/multitag.sh" + REDIRECT "$(POST ref)" + ;; esac if [ "$ITEM" = "/style.css" ]; then . "$_EXEC/cgilite/file.sh" [ -r "$_DATA/$ITEM" ] && FILE "$_DATA/$ITEM" \ || FILE "$_EXEC/style.css" +elif [ "$ITEM" = "/stereoview.js" ]; then + . "$_EXEC/cgilite/file.sh" + FILE "$_EXEC/stereoview.js" elif [ -f "$_DATA/$ITEM" ]; then case $ACTION in - tag) - ;; thumbnail) . "$_EXEC/cgilite/file.sh" + . "$_EXEC/thumbnail.sh" index="$_DATA/${ITEM%/*}/.index" thumb="$index/${ITEM##*/}"; thumb="${thumb%.*}.jpg" - [ -d "$index" -a \! -f "$thumb" ] \ - && file="$_DATA/$ITEM" . "$_EXEC/thumbnail.sh" + [ -d "$index" -a ! -f "$thumb" ] \ + && { printf %s "$ITEM" |grep -qE -e "${file_pattern}" ;} \ + && gen_thumb "$_DATA/$ITEM" "$thumb" FILE "$thumb" ;; delete) ;; - *) . "$_EXEC/cgilite/file.sh" + download) . "$_EXEC/cgilite/file.sh" fakemp4="$(COOKIE fakemp4)" FILE "$_DATA/$ITEM" "$([ "$fakemp4" = yes ] && printf 'video/mp4')" ;; + *) . "$_EXEC/view.sh" esac elif [ -d "$_DATA/$ITEM" ]; then case $ACTION in @@ -81,10 +89,6 @@ elif [ -d "$_DATA/$ITEM" ]; then fi REDIRECT "$(POST ref)" ;; - multitag) - . "$_EXEC/multitag.sh" - REDIRECT "$(POST ref)" - ;; *) . "$_EXEC/list.sh" ;; esac