Describe the bug
When calling getTracks(), some tracks will not include the property duration_ms as it is officially documented in type Tracks but instead include the property duration which is not documented in your types. This causes the duration to be undefined and is not usable for further processing.
I am using spotify-url-info version 3.1.9 and isomorphic-unfetch version 0.7.10
import fetch from "isomorphic-unfetch";
import spotify, { Tracks } from "spotify-url-info";
const { getTracks, getData } = spotify(fetch);
// when fetching tracks
const tracks = await getTracks(query);
tracks.forEach(track => {
console.log(track.duration_ms); // will be undefined for some tracks
console.log((track as Tracks & {duration?: number}).duration); // is included in some tracks but not all
});
Describe the bug When calling
getTracks()
, some tracks will not include the propertyduration_ms
as it is officially documented in typeTracks
but instead include the propertyduration
which is not documented in your types. This causes the duration to be undefined and is not usable for further processing.I am using
spotify-url-info
version 3.1.9 andisomorphic-unfetch
version 0.7.10Spotify URL(s)
Your Code
Example object response