1
Fork 0

Documentation!

This commit is contained in:
Bauke 2023-07-31 15:52:49 +02:00
parent 0e65c651e6
commit 15d819af22
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 3 additions and 0 deletions

View File

@ -79,6 +79,7 @@ async function main(): Promise<void> {
} }
} }
/** The status data from Tauon's remote API. */
type Status = { type Status = {
album: string; album: string;
artist: string; artist: string;
@ -90,10 +91,12 @@ type Status = {
}; };
}; };
/** Get the {@linkcode Status} from Tauon's remote API. */
async function getStatus(): Promise<Status> { async function getStatus(): Promise<Status> {
return await (await fetch(`${remoteApi}/status`)).json(); return await (await fetch(`${remoteApi}/status`)).json();
} }
/** Run a `notify-send` with the current song's artist and title. */
async function notifyCurrentSong(): Promise<void> { async function notifyCurrentSong(): Promise<void> {
const status = await getStatus(); const status = await getStatus();
await runCommand("notify-send", { await runCommand("notify-send", {