add additional_types to current_user_playing_track() (#1193)

Co-authored-by: Sebastian Held <sebastian.held@imst.de>
Co-authored-by: Stéphane Bruckert <stephane.bruckert@gmail.com>
This commit is contained in:
Sebastian Held 2025-04-21 22:41:02 +02:00 committed by GitHub
parent 5b018cf6af
commit 1a8d9da033
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -11,6 +11,8 @@ Add your changes below.
### Added ### Added
- Adds `additional_types` parameter to retrieve currently playing episode
### Fixed ### Fixed
### Removed ### Removed

View File

@ -1256,10 +1256,20 @@ class Spotify:
""" """
return self.me() return self.me()
def current_user_playing_track(self): def current_user_playing_track(self, market=None, additional_types=("track",)):
""" Get information about the current users currently playing track. """ Get information about the current users currently playing track.
Parameters:
- market - An ISO 3166-1 alpha-2 country code or the
string from_token.
- additional_types - list of item types to return.
valid types are: track and episode
""" """
return self._get("me/player/currently-playing") return self._get(
"me/player/currently-playing",
market=market,
additional_types=",".join(additional_types)
)
def current_user_saved_albums(self, limit=20, offset=0, market=None): def current_user_saved_albums(self, limit=20, offset=0, market=None):
""" Gets a list of the albums saved in the current authorized user's """ Gets a list of the albums saved in the current authorized user's