From c8fd7fe63f681a885fd95d9b12106b32b6729c25 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 25 Aug 2023 23:13:00 +0000 Subject: send done event --- lib/payments.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/payments.js b/lib/payments.js index fb7d9cc6..dba7f4d0 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -181,6 +181,8 @@ export let credit = async (hash, amount, memo, ref, type = types.internal) => { parseFloat(((amount * p.rate) / 100000000).toFixed(2)) ); + l(words); + const client = mqtt.connect('mqtt://ln.coinos.io', config.mqtt); const raw = `/app/data/uploads/${p.id}-raw.mp3`; const out = `/app/data/uploads/${p.id}.mp3`; @@ -191,11 +193,8 @@ export let credit = async (hash, amount, memo, ref, type = types.internal) => { .audioBitrate(128) .audioFrequency(44100) .toFormat('mp3') - .on('data', (chunk) => { - client.publish("mp3", chunk); - }) .on('end', () => { - console.log('File has been re-encoded successfully.'); + client.publish(username, "done"); }) .on('error', (err) => { console.error('Error:', err); -- cgit v1.2.3