1
Fork 0

Also do not output when music is stopped.

This commit is contained in:
Bauke 2024-02-28 16:34:02 +01:00
parent 4984001bf1
commit e31be56ff1
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 3 additions and 5 deletions

View File

@ -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<Status> {
/** Print the current song's artist and title. */
async function getCurrentSong(): Promise<void> {
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) {