From 50fcbeb9f09a7833558e48e16a37214af90220a2 Mon Sep 17 00:00:00 2001 From: Baud Date: Sat, 1 Jun 2024 15:51:38 +0100 Subject: [PATCH] Maybe? --- index.ts | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/index.ts b/index.ts index ecb8f82..bcecfe5 100644 --- a/index.ts +++ b/index.ts @@ -91,24 +91,28 @@ function handle_message(message: Partial) { status: transportInfo.status, }) }).catch((err) => { - console.log() + console.log(err) }) }, 1000) - newHyperdeck.sendCommand(new Commands.DeviceInfoCommand()).then((info) => { - for (let index = 0; index < info.slots; index++) { - setInterval(() => { - newHyperdeck.sendCommand(new Commands.SlotInfoCommand(index)).then((slot) => { - notifyClients({ - event: "record_time_remaining", - hyperdeck_id: message.id, - slot_id: slot.slotId, - remaining: slot.recordingTime + setTimeout(() => { + newHyperdeck.sendCommand(new Commands.DeviceInfoCommand()).then((info) => { + for (let index = 0; index < info.slots; index++) { + setInterval(() => { + newHyperdeck.sendCommand(new Commands.SlotInfoCommand(index)).then((slot) => { + notifyClients({ + event: "record_time_remaining", + hyperdeck_id: message.id, + slot_id: slot.slotId, + remaining: slot.recordingTime + }) + }).catch((err) => { + console.log(err) }) - }).catch(() => {}) - }, 1000) - } - }) + }, 1000) + } + }) + }, 1000) }) newHyperdeck.on('notify.slot', function (slot) {