Adds option to retrieve currently playing podcast episode. Fixes #562 (#563)

* Adds option to retrieve currently playing podcast episode. Fixes #562

* Fixing lint error: a bit over the 99 character limit

* Fixing lint error: ugh
This commit is contained in:
Ilya Gubins 2020-08-29 12:38:39 +02:00 committed by GitHub
parent 3eb3154ddc
commit a7dfda54d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1620,21 +1620,24 @@ class Spotify(object):
"""
return self._get("me/player/devices")
def current_playback(self, market=None):
def current_playback(self, market=None, additional_types=None):
""" Get information about user's current playback.
Parameters:
- market - an ISO 3166-1 alpha-2 country code.
- additional_types - `episode` to get podcast track information
"""
return self._get("me/player", market=market)
return self._get("me/player", market=market, additional_types=additional_types)
def currently_playing(self, market=None):
def currently_playing(self, market=None, additional_types=None):
""" Get user's currently playing track.
Parameters:
- market - an ISO 3166-1 alpha-2 country code.
- additional_types - `episode` to get podcast track information
"""
return self._get("me/player/currently-playing", market=market)
return self._get("me/player/currently-playing", market=market,
additional_types=additional_types)
def transfer_playback(self, device_id, force_play=True):
""" Transfer playback to another device.