Restructure

This commit is contained in:
Geomitron
2023-11-27 18:53:09 -06:00
parent 558d76f582
commit 49c3f38f99
758 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import { AlbumArtResult } from '../../shared/interfaces/songDetails.interface'
import { IPCInvokeHandler } from '../../shared/IPCHandler'
import { serverURL } from '../../shared/Paths'
/**
* Handles the 'album-art' event.
*/
class AlbumArtHandler implements IPCInvokeHandler<'album-art'> {
event = 'album-art' as const
/**
* @returns an `AlbumArtResult` object containing the album art for the song with `songID`.
*/
async handler(songID: number): Promise<AlbumArtResult> {
const response = await fetch(`https://${serverURL}/api/data/album-art/${songID}`)
return await response.json()
}
}
export const albumArtHandler = new AlbumArtHandler()