Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@send_and_process(single(SimpleAlbumPaging))
@maximise_limit(50)
def artist_albums(
self,
artist_id: str,
include_groups: List[Union[str, AlbumGroup]] = None,
market: str = None,
limit: int = 20,
offset: int = 0
) -> SimpleAlbumPaging:
"""
Get an artist's albums.
Parameters
----------
artist_id
the artist ID
@send_and_process(single(CategoryPaging, from_item='categories'))
@maximise_limit(50)
def categories(
self,
country: str = None,
locale: str = None,
limit: int = 20,
offset: int = 0
) -> CategoryPaging:
"""
Get a list of categories used to tag items in Spotify.
Parameters
----------
country
an ISO 3166-1 alpha-2 country code
locale
@send_and_process(nothing)
def playback_next(self, device_id: str = None) -> None:
"""
Skip user's playback to next track.
Parameters
----------
device_id
device to skip track on
"""
return self._post('me/player/next', device_id=device_id)
@send_and_process(nothing)
def playback_transfer(self, device_id: str, force_play: bool = False) -> None:
"""
Transfer playback to another device.
Parameters
----------
device_id
device to transfer playback to
force_play
true: play after transfer, false: keep current state
"""
data = {
'device_ids': [device_id],
'play': force_play
}
return self._put('me/player', payload=data)
@send_and_process(nothing)
def playback_seek(self, position_ms: int, device_id: str = None) -> None:
"""
Seek to position in current playing track.
Parameters
----------
position_ms
position on track
device_id
device to seek on
"""
return self._put(
'me/player/seek',
position_ms=position_ms,
device_id=device_id
)
@send_and_process(single(FullArtist))
def artist(self, artist_id: str) -> FullArtist:
"""
Get information for an artist.
Parameters
----------
artist_id
artist ID
"""
return self._get('artists/' + artist_id)
@send_and_process(nothing)
def playback_queue_add(self, uri: str, device_id: str = None) -> None:
"""
Add a track or an episode to a user's queue.
Parameters
----------
uri
resource to add, track or episode
device_id
devide to extend the queue on
"""
return self._post('me/player/queue', uri=uri, device_id=device_id)
@send_and_process(nothing)
def playlist_change_details(
self,
playlist_id: str,
name: str = None,
public: bool = None,
collaborative: bool = None,
description: str = None
) -> None:
"""
Change a playlist's details.
Parameters
----------
playlist_id
playlist ID
name
@send_and_process(single(CurrentlyPlaying))
def playback_currently_playing(
self,
market: str = None,
tracks_only: bool = False
) -> CurrentlyPlaying:
"""
Get user's currently playing track.
Only one of the scopes above is required.
Parameters
----------
market
an ISO 3166-1 alpha-2 country code or 'from_token'
tracks_only
return only tracks in the currently playing item,