From 1a8d9da033da22612d56570fc9079dd4c431e839 Mon Sep 17 00:00:00 2001 From: Sebastian Held Date: Mon, 21 Apr 2025 22:41:02 +0200 Subject: [PATCH] add additional_types to current_user_playing_track() (#1193) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastian Held Co-authored-by: Stéphane Bruckert --- CHANGELOG.md | 2 ++ spotipy/client.py | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7df630..81a3f0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ Add your changes below. ### Added +- Adds `additional_types` parameter to retrieve currently playing episode + ### Fixed ### Removed diff --git a/spotipy/client.py b/spotipy/client.py index 03825a8..17b60c1 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -1256,10 +1256,20 @@ class Spotify: """ 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. + + 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): """ Gets a list of the albums saved in the current authorized user's