Exspotify.Playlists (Exspotify v0.1.0)
View SourceProvides functions for interacting with the Playlists endpoints of the Spotify Web API. Deprecated endpoints (featured playlists, category playlists) are not included. See: https://developer.spotify.com/documentation/web-api/reference/playlists
Summary
Functions
Add a custom cover image to a playlist. Warning: This will change the playlist's cover image. Requires: playlist-modify-public or playlist-modify-private scope. The image must be a Base64-encoded JPEG.
Add items (tracks/episodes) to a playlist. Warning: This will change the playlist's items. Requires: playlist-modify-public or playlist-modify-private scope.
Change a playlist's details (name, description, public, collaborative). Warning: This will change the playlist's metadata. Requires: playlist-modify-public or playlist-modify-private scope.
Check if one or more users are following a playlist.
Create a playlist for a user. Warning: This will create a new playlist in the user's account. Requires: playlist-modify-public or playlist-modify-private scope.
Follow a playlist. Warning: This will add the playlist to the user's library. Requires: playlist-modify-public or playlist-modify-private scope.
Get the current user's playlists (paginated). https://developer.spotify.com/documentation/web-api/reference/get-current-users-playlists
Get a playlist by its Spotify ID. Requires: playlist-read-private or playlist-read-collaborative scope for private playlists.
Get the current image for a playlist.
Get items (tracks/episodes) in a playlist (paginated). https://developer.spotify.com/documentation/web-api/reference/get-playlists-tracks
Get a user's public playlists (paginated). https://developer.spotify.com/documentation/web-api/reference/get-list-users-playlists
Remove items (tracks/episodes) from a playlist. Warning: This will change the playlist's items. Requires: playlist-modify-public or playlist-modify-private scope.
Unfollow a playlist. Warning: This will remove the playlist from the user's library. Requires: playlist-modify-public or playlist-modify-private scope.
Update (reorder/replace) items in a playlist. Warning: This will change the playlist's items. Requires: playlist-modify-public or playlist-modify-private scope.
Functions
@spec add_custom_playlist_cover_image(String.t(), String.t(), String.t()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Add a custom cover image to a playlist. Warning: This will change the playlist's cover image. Requires: playlist-modify-public or playlist-modify-private scope. The image must be a Base64-encoded JPEG.
@spec add_items_to_playlist(String.t(), String.t(), map()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Add items (tracks/episodes) to a playlist. Warning: This will change the playlist's items. Requires: playlist-modify-public or playlist-modify-private scope.
@spec change_playlist_details(String.t(), String.t(), map()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Change a playlist's details (name, description, public, collaborative). Warning: This will change the playlist's metadata. Requires: playlist-modify-public or playlist-modify-private scope.
@spec check_if_user_follows_playlist(String.t(), String.t(), [String.t()]) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Check if one or more users are following a playlist.
@spec create_playlist(String.t(), String.t(), String.t(), map()) :: {:ok, Exspotify.Structs.Playlist.t()} | {:error, Exspotify.Error.t()}
Create a playlist for a user. Warning: This will create a new playlist in the user's account. Requires: playlist-modify-public or playlist-modify-private scope.
@spec follow_playlist(String.t(), String.t(), map()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Follow a playlist. Warning: This will add the playlist to the user's library. Requires: playlist-modify-public or playlist-modify-private scope.
@spec get_current_users_playlists( String.t(), keyword() ) :: {:ok, Exspotify.Structs.Paging.t()} | {:error, Exspotify.Error.t()}
Get the current user's playlists (paginated). https://developer.spotify.com/documentation/web-api/reference/get-current-users-playlists
@spec get_playlist(String.t(), String.t()) :: {:ok, Exspotify.Structs.Playlist.t()} | {:error, Exspotify.Error.t()}
Get a playlist by its Spotify ID. Requires: playlist-read-private or playlist-read-collaborative scope for private playlists.
@spec get_playlist_cover_image(String.t(), String.t()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Get the current image for a playlist.
@spec get_playlist_items(String.t(), String.t(), keyword()) :: {:ok, Exspotify.Structs.Paging.t()} | {:error, Exspotify.Error.t()}
Get items (tracks/episodes) in a playlist (paginated). https://developer.spotify.com/documentation/web-api/reference/get-playlists-tracks
@spec get_users_playlists(String.t(), String.t(), keyword()) :: {:ok, Exspotify.Structs.Paging.t()} | {:error, Exspotify.Error.t()}
Get a user's public playlists (paginated). https://developer.spotify.com/documentation/web-api/reference/get-list-users-playlists
@spec remove_playlist_items(String.t(), String.t(), map()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Remove items (tracks/episodes) from a playlist. Warning: This will change the playlist's items. Requires: playlist-modify-public or playlist-modify-private scope.
@spec unfollow_playlist(String.t(), String.t()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Unfollow a playlist. Warning: This will remove the playlist from the user's library. Requires: playlist-modify-public or playlist-modify-private scope.
@spec update_playlist_items(String.t(), String.t(), map(), keyword()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Update (reorder/replace) items in a playlist. Warning: This will change the playlist's items. Requires: playlist-modify-public or playlist-modify-private scope.