Update formatting

This commit is contained in:
Geomitron
2023-11-23 13:00:30 -06:00
parent 93aae097c6
commit cddec0d9d4
75 changed files with 4900 additions and 3279 deletions

View File

@@ -1,25 +1,26 @@
import { Injectable } from '@angular/core'
import { ElectronService } from './electron.service'
@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class AlbumArtService {
constructor(private electronService: ElectronService) { }
constructor(private electronService: ElectronService) { }
private imageCache: { [songID: number]: string } = {}
private imageCache: { [songID: number]: string } = {}
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.base64Art
} else {
this.imageCache[songID] = 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.base64Art
} else {
this.imageCache[songID] = null
}
}
return this.imageCache[songID]
}
}
return this.imageCache[songID]
}
}