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,14 +160,18 @@ handle_fallback() {
exit 1
}
size=$(stat -c%s "${FILE_PATH}") # file size in bytes
handle_extension
#MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )"
MIMETYPE="$(xdg-mime query filetype "${FILE_PATH}" )"
if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then
if [ $size -le 10485760 ]; then
handle_extension
#MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )"
MIMETYPE="$(xdg-mime query filetype "${FILE_PATH}" )"
if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then
handle_image "${MIMETYPE}"
fi
handle_mime "${MIMETYPE}"
fi
handle_mime "${MIMETYPE}"
handle_fallback
exit 1