Skip to content

Commit

Permalink
feat(me): add currentlyPlayingTrack route
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvdkolk authored Nov 30, 2024
1 parent 3464e3b commit c01dcb9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lib/me/MeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ export class MeManager extends Manager {
return json as PlayerState;
}

/**
* @description Get the object currently being played on the user's Spotify account.
* @returns {Promise} Returns a promise with the current playing information.
*/
async getCurrentlyPlayingTrack(): Promise<PlayerState> {
const res = await this.http.get(`/v1/me/player/currently-playing`);

const json = res.data;

return json as PlayerState;

Check failure on line 115 in src/lib/me/MeManager.ts

View workflow job for this annotation

GitHub Actions / lint

Delete `·`
}

/**
* @description Check if one or more tracks is saved in the current user's library. (required scropes: user-library-read).
* @returns {Promise<boolean[]>} Returns a promise with the an array of booleans.
Expand Down

0 comments on commit c01dcb9

Please sign in to comment.