From d2d32556e896eaa85888d4b5eb5051db4e89ae54 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Wed, 24 Aug 2022 12:32:54 +0700 Subject: [PATCH] fix notification bugging out (i hope) --- src/main/plugins/playbackNotifications.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/plugins/playbackNotifications.ts b/src/main/plugins/playbackNotifications.ts index e066e394..26d5bb03 100644 --- a/src/main/plugins/playbackNotifications.ts +++ b/src/main/plugins/playbackNotifications.ts @@ -100,8 +100,11 @@ export default class playbackNotifications { console.log(join(app.getPath("temp"), `${a.songId}-${a.artwork.url.split("/").pop()}`)); const dest = createWriteStream(join(app.getPath("temp"), `${a.songId}-${a.artwork.url.split("/").pop()}`)); // @ts-ignore - res.body.pipe(dest); - this.createNotification(a); + let stream = res.body.pipe(dest); + stream.on('finish', () =>{ + this.createNotification(a); + }); + }); } else { fetch(a.artwork.url).then(async (blob) => {