Replace Database connection with web server API

This commit is contained in:
Geomitron
2020-05-03 16:36:08 -04:00
parent 0b4e50174d
commit a3271bf164
20 changed files with 190 additions and 293 deletions

View File

@@ -8,13 +8,13 @@ export class AlbumArtService {
constructor(private electronService: ElectronService) { }
private imageCache: { [songID: number]: Buffer } = {}
private imageCache: { [songID: number]: string } = {}
async getImage(songID: number): Promise<Buffer | null> {
async getImage(songID: number): Promise<string | null> {
if (this.imageCache[songID] == undefined) {
const albumArtResult = await this.electronService.invoke('album-art', songID)
if (albumArtResult) {
this.imageCache[songID] = albumArtResult.art
this.imageCache[songID] = albumArtResult.base64Art
} else {
this.imageCache[songID] = null
}