Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is_local should be an optional property of SpotifyApi.TrackObjectFull #500

Open
RuurdBijlsma opened this issue Nov 10, 2023 · 1 comment

Comments

@RuurdBijlsma
Copy link

RuurdBijlsma commented Nov 10, 2023

When you retrieve a spotify track from either "liked" or a playlist, a property is added to the track object: is_local.

Example in api docs: https://developer.spotify.com/documentation/web-api/reference/get-users-saved-tracks

Current SpotifyApi.TrackObjectFull type definition:

interface TrackObjectFull extends TrackObjectSimplified {
  album: AlbumObjectSimplified;
  external_ids: ExternalIdObject;
  popularity: number;
}

interface TrackObjectSimplified {
  artists: ArtistObjectSimplified[];
  available_markets?: string[];
  disc_number: number;
  duration_ms: number;
  explicit: boolean;
  external_urls: ExternalUrlObject;
  href: string;
  id: string;
  is_playable?: boolean;
  linked_from?: TrackLinkObject;
  name: string;
  preview_url: string;
  track_number: number;
  type: 'track';
  uri: string;
}

In the API docs you can see in the docs that is_local is a property on the track object, on the same level as duration_ms, name, artists, album, etc.

Suggested fix:

Adjust TrackObjectFull, because PlaylistTrackObject and SavedTrackObject only use the full version, not the simplified track object:

interface TrackObjectFull extends TrackObjectSimplified {
  album: AlbumObjectSimplified;
  external_ids: ExternalIdObject;
  popularity: number;
  is_local?: boolean;
}
@Abdullah-Malik
Copy link

If you are looking to write an app with a newly written and updated SDK, take a look - https://github.com/Abdullah-Malik/spotified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants