Fixed ranger scope for comicbooks (apparently broken in update)

This commit is contained in:
lanxu 2017-12-17 15:29:33 +02:00
parent 14ff1531cb
commit 143a9b7921

View File

@ -87,6 +87,14 @@ handle_extension() {
handle_image() {
local mimetype="${1}"
case "${FILE_EXTENSION_LOWER}" in
# Comic book previews
cbz|cbr|epub)
comicthumb "${FILE_PATH}" "${IMAGE_CACHE_PATH}" 512 > /dev/null 2>&1 && exit 6
exit 1;;
esac
case "${mimetype}" in
# SVG
image/svg+xml)
@ -109,13 +117,6 @@ handle_image() {
application/pdf)
pdftoppm -jpeg -singlefile "$path" "${cached//.jpg}" && exit 6;;
esac
case "${FILE_EXTENSION_LOWER}" in
# Comic book previews
cbz|cbr|epub)
comicthumb "$path" "$cached" 512 > /dev/null 2>&1 && exit 6 || exit 1;;
esac
}
handle_mime() {
@ -161,7 +162,8 @@ handle_fallback() {
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}" )"
if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then
handle_image "${MIMETYPE}"
fi