Hey there @scriptex , thanks for the package!
On some less popular songs trackApi.getInfo() returns a track where .album is undefined. This probably is a limitation of the API, and not of your package, so no need to change that. However, the unexpected type change to undefined is not properly described in the typescript schema. Thus, this project looses its type safety. I would appreciate marking .album as optional in the TS schemes to fix this.
Here's an example script to test what I mean:
import { LastFMTrack } from 'lastfm-ts-api'
import config from '../../../../../config'
const trackApi = new LastFMTrack(
config.metadataProviders.lastfm.clientId ?? '',
config.metadataProviders.lastfm.clientSecret
)
const trackInfo = await trackApi.getInfo({
track: 'Bella Napoli',
artist: 'DJ Robin'
})
console.log(trackInfo.track.album)
Hey there @scriptex , thanks for the package!
On some less popular songs trackApi.getInfo() returns a track where
.albumis undefined. This probably is a limitation of the API, and not of your package, so no need to change that. However, the unexpected type change to undefined is not properly described in the typescript schema. Thus, this project looses its type safety. I would appreciate marking.albumas optional in the TS schemes to fix this.Here's an example script to test what I mean: