« get me outta code hell

Make --play-opts work again (and use variable name playOpts instead of playArgs) - http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
path: root/src/loop-play.js
diff options
context:
space:
mode:
authorliam4 <towerofnix@gmail.com>2017-07-18 17:58:48 -0300
committerliam4 <towerofnix@gmail.com>2017-07-18 17:58:48 -0300
commit398fed8425f264bec1d2dcfc10d0831e209a8184 (patch)
tree1b629003f0d03fae6f84364a8b597a6b942404d7 /src/loop-play.js
parent79852531894c2dab32184bc98299b09bda16b96d (diff)
Make --play-opts work again (and use variable name playOpts instead of playArgs)
Diffstat (limited to 'src/loop-play.js')
-rw-r--r--src/loop-play.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/loop-play.js b/src/loop-play.js
index a38e524..f36f1fb 100644
--- a/src/loop-play.js
+++ b/src/loop-play.js
@@ -63,7 +63,7 @@ class DownloadController extends EventEmitter {
 class PlayController {
   constructor(picker, downloadController) {
     this.currentTrack = null
-    this.playArgs = []
+    this.playOpts = []
     this.process = null
     this.picker = picker
     this.downloadController = downloadController
@@ -138,7 +138,8 @@ class PlayController {
     this.process = spawn('mpv', [
       '--input-file=' + this.fifo.path,
       '--no-audio-display',
-      file
+      file,
+      ...this.playOpts
     ])
 
     this.process.stderr.on('data', data => {
@@ -243,7 +244,7 @@ class PlayController {
   }
 }
 
-module.exports = function loopPlay(picker, playArgs = []) {
+module.exports = function loopPlay(picker, playOpts = []) {
   // Looping play function. Takes one argument, the "picker" function,
   // which returns a track to play. Stops when the result of the picker
   // function is null (or similar). Optionally takes a second argument
@@ -251,7 +252,7 @@ module.exports = function loopPlay(picker, playArgs = []) {
 
   const downloadController = new DownloadController()
   const playController = new PlayController(picker, downloadController)
-  playController.playArgs = playArgs
+  playController.playOpts = playOpts
 
   const promise = playController.loopPlay()