Disable trailing execution of throttled commands

We don't want to run the function at the end of the throttling period.
This causes the track to start, then re-start after the timeout ends.
This commit is contained in:
Annika Backstrom 2017-04-09 22:50:06 -04:00
parent 9fb3b6bc1c
commit 9787deb38e

View File

@ -19,9 +19,9 @@ class MediaPlayer extends ChildProcessEmitter {
return line.substr(0, 3) == '@F '
});
this.stopThrottled = throttle(config.stop_throttle || DEFAULT_STOP_THROTTLE, this._stop);
this.pauseThrottled = throttle(config.pause_throttle || DEFAULT_PAUSE_THROTTLE, this._pause);
this.playFileThrottled = throttle(config.play_throttle || DEFAULT_PLAY_THROTTLE, this._playFile);
this.stopThrottled = throttle(config.stop_throttle || DEFAULT_STOP_THROTTLE, true, this._stop);
this.pauseThrottled = throttle(config.pause_throttle || DEFAULT_PAUSE_THROTTLE, true, this._pause);
this.playFileThrottled = throttle(config.play_throttle || DEFAULT_PLAY_THROTTLE, true, this._playFile);
// always throttled
this.unknown = throttle(config.unknown_throttle || DEFAULT_UNKNOWN_THROTTLE, this._unknown);