Disabled ranger scope for files larger than 10 megabytes

This commit is contained in:
lanxu 2018-02-03 20:26:11 +02:00
parent f490e6e8ef
commit fed90585a6

View File

@ -160,7 +160,9 @@ handle_fallback() {
exit 1 exit 1
} }
size=$(stat -c%s "${FILE_PATH}") # file size in bytes
if [ $size -le 10485760 ]; then
handle_extension handle_extension
#MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )" #MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )"
MIMETYPE="$(xdg-mime query filetype "${FILE_PATH}" )" MIMETYPE="$(xdg-mime query filetype "${FILE_PATH}" )"
@ -168,6 +170,8 @@ if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then
handle_image "${MIMETYPE}" handle_image "${MIMETYPE}"
fi fi
handle_mime "${MIMETYPE}" handle_mime "${MIMETYPE}"
fi
handle_fallback handle_fallback
exit 1 exit 1