From aa9a7692e2f7c0be0ac12047703e167655d8d9a6 Mon Sep 17 00:00:00 2001 From: Ondrej Zara Date: Wed, 20 Mar 2019 16:20:09 +0100 Subject: [PATCH] fixes --- commands.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/commands.js b/commands.js index ce50d3e..e15fbe6 100644 --- a/commands.js +++ b/commands.js @@ -57,7 +57,7 @@ class Normal extends Command { class Welcome extends Command { _processBuffer() { let line = this._getLine(); - if (line) { this._done(line); } + if (line) { this._done([line]); } } } @@ -78,6 +78,12 @@ class AlbumArt extends Command { let line = this._getLine(); if (!line) { return; } this._lines.push(line); + + if (line.startsWith("ACK")) { // no art! + this._done(this._lines); + return; + } + this._size = Number(line.split(": ").pop()); log("size", this._size); }