summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2019-12-26 18:52:12 +0100
committertoonn <toonn@toonn.io>2019-12-26 18:56:50 +0100
commit617b36ac697a099a59a5e5f29fbbefb29d93e407 (patch)
tree7962c4dad2b363baa413f9dffcca82413e149a0e /ranger
parent604b2970964c9d3159807a29a690e03c8d796127 (diff)
downloadranger-617b36ac697a099a59a5e5f29fbbefb29d93e407.tar.gz
Add Direct Stream Digital/Transfer to mime types
Direct Stream Digital/Transfer (`.dsf`) files have MIME type
`application/octet-stream` but they're audio so `audio/something` is
more useful for rifle.

Scope also runs `mediainfo` and `exiftool` for miscellaneous `audio/*`
files but we can't match on MIME type here so I added a similar clause
in `handle_extension`.
Diffstat (limited to 'ranger')
-rw-r--r--ranger/data/mime.types1
-rwxr-xr-xranger/data/scope.sh9
2 files changed, 9 insertions, 1 deletions
diff --git a/ranger/data/mime.types b/ranger/data/mime.types
index bcf28acf..c20003d3 100644
--- a/ranger/data/mime.types
+++ b/ranger/data/mime.types
@@ -23,6 +23,7 @@ audio/ogg               oga ogg spx opus
 audio/wavpack           wv wvc
 audio/webm              weba
 audio/x-ape             ape
+audio/x-dsdiff          dsf
 audio/x-flac            flac
 
 image/vnd.djvu          djvu
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh
index 670d73d1..caa9475f 100755
--- a/ranger/data/scope.sh
+++ b/ranger/data/scope.sh
@@ -87,12 +87,19 @@ handle_extension() {
             w3m -dump "${FILE_PATH}" && exit 5
             lynx -dump -- "${FILE_PATH}" && exit 5
             elinks -dump "${FILE_PATH}" && exit 5
-            ;; # Continue with next handler on failure
+            ;;
+
         ## JSON
         json)
             jq --color-output . "${FILE_PATH}" && exit 5
             python -m json.tool -- "${FILE_PATH}" && exit 5
             ;;
+
+        ## Direct Stream Digital/Transfer (DSDIFF)
+        dsf)
+            mediainfo "${FILE_PATH}" && exit 5
+            exiftool "${FILE_PATH}" && exit 5
+            ;; # Continue with next handler on failure
     esac
 }