From e31be56ff1e43b299013f6e77669a03da04b5146 Mon Sep 17 00:00:00 2001 From: Bauke Date: Wed, 28 Feb 2024 16:34:02 +0100 Subject: [PATCH] Also do not output when music is stopped. --- .bauke/scripts/tauon-controls.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.bauke/scripts/tauon-controls.ts b/.bauke/scripts/tauon-controls.ts index 880808d..3b5e4cc 100644 --- a/.bauke/scripts/tauon-controls.ts +++ b/.bauke/scripts/tauon-controls.ts @@ -85,7 +85,7 @@ type Status = { artist: string; id: number; progress: number; - status: "playing" | "paused"; + status: "playing" | "paused" | "stopped"; title: string; track: { duration: number; @@ -100,11 +100,9 @@ async function getStatus(): Promise { /** Print the current song's artist and title. */ async function getCurrentSong(): Promise { const status = await getStatus(); - if (status.status === "paused") { - return; + if (status.status === "playing") { + console.log(`${status.artist} - ${status.title}`); } - - console.log(`${status.artist} - ${status.title}`); } if (import.meta.main) {