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

feat(me): add currentlyPlayingTrack route #65

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/lib/me/MeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ 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`);

return res.data as PlayerState;
}

/**
* @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
Loading