From 2f73548701c3f0b0a602933cf2173aa4a2dcc0f3 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Tue, 29 Aug 2023 15:43:58 +0900 Subject: [PATCH] fix(tuna): handle `playPaused` (#1) --- plugins/tuna-obs/back.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/tuna-obs/back.js b/plugins/tuna-obs/back.js index 5b3eec65..f38ab3a0 100644 --- a/plugins/tuna-obs/back.js +++ b/plugins/tuna-obs/back.js @@ -36,6 +36,12 @@ module.exports = async (win) => { data.progress = secToMilisec(t); post(data); }); + ipcMain.on('playPaused', (_, { isPaused, elapsedSeconds }) => { + if (!data.title) return; + data.status = isPaused ? 'stopped' : 'playing'; + data.progress = secToMilisec(elapsedSeconds); + post(data); + }); registerCallback((songInfo) => { if (!songInfo.title && !songInfo.artist) {