From d65dfa3e6c4e589f6f6c40f9b6c7753c58755970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=BD=C3=A1ra?= Date: Sat, 9 May 2020 10:08:36 +0200 Subject: [PATCH] noidle fix --- package.json | 2 +- queue.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ad34e33..d00ac7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ws2mpd", - "version": "2.2.0", + "version": "2.2.1", "description": "", "main": "index.js", "scripts": { diff --git a/queue.js b/queue.js index c8113fe..27bfb96 100644 --- a/queue.js +++ b/queue.js @@ -119,8 +119,12 @@ exports.Queue = class extends EventEmitter { } add(str) { - if (str == "noidle" && this._current instanceof Idle) { - this._mpd.write(str + "\n"); + if (str == "noidle") { + if (this._current instanceof Idle) { + this._mpd.write(str + "\n"); + } else { + log("throwing away rogue noidle"); + } return; } this._waiting.push(str);