« get me outta code hell

Fix a crash from having "options" in the default playlist.json file - http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorliam4 <towerofnix@gmail.com>2017-06-26 20:26:01 -0300
committerliam4 <towerofnix@gmail.com>2017-06-26 20:26:01 -0300
commit173bd7386059baf89286485efe7d50577bef757a (patch)
tree3a8c5bba08e6530937faf3ffdf2a3eab7aabe381
parent42719dbd517f0fd5af12f36ba9e19794825b904f (diff)
Fix a crash from having "options" in the default playlist.json file
Essentially it would try to run processArgv(.options, optionFunctions)
before optionFunctions is defined. This was solved by moving the call
that would cause that to happen after optionFunctions is defined.
-rwxr-xr-xsrc/http-music.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/http-music.js b/src/http-music.js
index 6abda75..48aff95 100755
--- a/src/http-music.js
+++ b/src/http-music.js
@@ -22,8 +22,6 @@ Promise.resolve()
     let sourcePlaylist = null
     let activePlaylist = null
 
-    await openPlaylist('./playlist.json')
-
     let pickerType = 'shuffle'
     let downloaderType = 'http'
     let playOpts = []
@@ -248,6 +246,8 @@ Promise.resolve()
       }
     }
 
+    await openPlaylist('./playlist.json')
+
     await processArgv(process.argv, optionFunctions)
 
     if (activePlaylist === null) {