From 398fed8425f264bec1d2dcfc10d0831e209a8184 Mon Sep 17 00:00:00 2001 From: liam4 Date: Tue, 18 Jul 2017 17:58:48 -0300 Subject: Make --play-opts work again (and use variable name playOpts instead of playArgs) --- src/loop-play.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') 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() -- cgit 1.3.0-6-gf8a5