« get me outta code hell

Output sane extnames in local downloader - http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-03-03 08:38:19 -0400
committerFlorrie <towerofnix@gmail.com>2018-03-03 08:38:19 -0400
commit4ff150e42f03d51ddfed228e7da33b19eb773eaf (patch)
tree9e7516acaef908c26f02274f04ac5484b940345c
parentdb9a8b38ed93891e6e77ddf4234600dc57eb2b23 (diff)
Output sane extnames in local downloader
-rw-r--r--src/downloaders.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/downloaders.js b/src/downloaders.js
index 138b2d6..663e493 100644
--- a/src/downloaders.js
+++ b/src/downloaders.js
@@ -79,7 +79,7 @@ function makeLocalDownloader() {
     // TODO: Is it necessary to sanitize here?
     // Haha, the answer to "should I sanitize" is probably always YES..
     const base = path.basename(arg, path.extname(arg))
-    const file = dir + '/' + sanitize(base) + '.mp3'
+    const file = dir + '/' + sanitize(base) + path.extname(arg)
     return copyFile(arg, file)
       .then(() => file)
   }