« get me outta code hell

sanitize yo cache - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2020-02-04 23:04:57 -0400
committerFlorrie <towerofnix@gmail.com>2020-02-04 23:04:57 -0400
commit9ee3dca97a505f7e984517d7d393c993a8961ced (patch)
tree48d9a72dd9319b428e02ff16794b319c2abec643
parent8cbae1fe17bbf51060734861540a398631635ad7 (diff)
sanitize yo cache
-rw-r--r--downloaders.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/downloaders.js b/downloaders.js
index e18c8e0..941c805 100644
--- a/downloaders.js
+++ b/downloaders.js
@@ -32,7 +32,7 @@ const copyFile = (source, target) => {
   })
 }
 
-const disableBackResolving = arg => arg.split('/').map(str => str.replace(/^\../, '_..')).join('/')
+// const disableBackResolving = arg => arg.split('/').map(str => str.replace(/^\../, '_..')).join('/')
 
 const cachify = (identifier, keyFunction, baseFunction) => {
   return async arg => {
@@ -44,7 +44,7 @@ const cachify = (identifier, keyFunction, baseFunction) => {
     // Determine where the final file will end up. This is just a directory -
     // the file's own name is determined by the downloader.
     const cacheDir = downloaders.rootCacheDir + '/' + identifier
-    const finalDirectory = cacheDir + '/' + disableBackResolving(keyFunction(arg))
+    const finalDirectory = cacheDir + '/' + sanitize(keyFunction(arg))
 
     // Check if that directory only exists. If it does, return the file in it,
     // because it being there means we've already downloaded it at some point