1
Fork 0

Output empty lines for no results and no longer escape ampersands.

This commit is contained in:
Bauke 2024-03-28 19:19:43 +01:00
parent 6baf532b42
commit 76a34e4d9c
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 5 additions and 1 deletions

View File

@ -8,4 +8,6 @@ count=$(echo $json | jq -j '.unreads | length')
if [[ ! $count -eq "0" ]]; then
echo $count
else
echo
fi

View File

@ -101,7 +101,9 @@ async function getStatus(): Promise<Status> {
async function getCurrentSong(): Promise<void> {
const status = await getStatus();
if (status.status === "playing") {
console.log(`${status.artist} - ${status.title}`.replaceAll("&", "&amp;"));
console.log(`${status.artist} - ${status.title}`);
} else {
console.log("");
}
}