ClientLibraryApi

class ClientLibraryApi(api: GenericSpotifyApi) : SpotifyEndpoint

Endpoints for retrieving information about, and managing, tracks and albums that the current user has saved in their “Your Music” library.

Api Reference

Constructors

ClientLibraryApi
Link copied to clipboard
common
fun ClientLibraryApi(api: GenericSpotifyApi)

Functions

add
Link copied to clipboard
common
suspend fun add(type: LibraryType, vararg ids: String)
Save one or more of LibraryType to the current user’s ‘Your Music’ library.
suspend fun add(type: LibraryType, id: String)
Save one of LibraryType to the current user’s ‘Your Music’ library.
addRestAction
Link copied to clipboard
common
fun addRestAction(type: LibraryType, vararg ids: String): SpotifyRestAction<Unit>
Save one or more of LibraryType to the current user’s ‘Your Music’ library.
fun addRestAction(type: LibraryType, id: String): SpotifyRestAction<Unit>
Save one of LibraryType to the current user’s ‘Your Music’ library.
contains
Link copied to clipboard
common
suspend fun contains(type: LibraryType, vararg ids: String): List<Boolean>
Check if one or more of LibraryType is already saved in the current Spotify user’s ‘Your Music’ library.
suspend fun contains(type: LibraryType, id: String): Boolean
Check if the LibraryType with id id is already saved in the current Spotify user’s ‘Your Music’ library.
containsRestAction
Link copied to clipboard
common
fun containsRestAction(type: LibraryType, vararg ids: String): SpotifyRestAction<List<Boolean>>
Check if one or more of LibraryType is already saved in the current Spotify user’s ‘Your Music’ library.
fun containsRestAction(type: LibraryType, id: String): SpotifyRestAction<Boolean>
Check if the LibraryType with id id is already saved in the current Spotify user’s ‘Your Music’ library.
getSavedAlbums
Link copied to clipboard
common
suspend fun getSavedAlbums(limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market? = null): PagingObject<SavedAlbum>
Get a list of the albums saved in the current Spotify user’s ‘Your Music’ library.
getSavedAlbumsRestAction
Link copied to clipboard
common
fun getSavedAlbumsRestAction(limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market? = null): SpotifyRestAction<PagingObject<SavedAlbum>>
Get a list of the albums saved in the current Spotify user’s ‘Your Music’ library.
getSavedEpisodes
Link copied to clipboard
common
suspend fun getSavedEpisodes(limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market? = null): PagingObject<SavedEpisode>
Get a list of the episodes saved in the current Spotify user’s library.
getSavedEpisodesRestAction
Link copied to clipboard
common
suspend fun getSavedEpisodesRestAction(limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market? = null): SpotifyRestAction<PagingObject<SavedEpisode>>
Get a list of the episodes saved in the current Spotify user’s library.
getSavedShows
Link copied to clipboard
common
suspend fun getSavedShows(limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null): PagingObject<SavedShow>
Get a list of shows saved in the current Spotify user’s library.
getSavedShowsRestAction
Link copied to clipboard
common
fun getSavedShowsRestAction(limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null): SpotifyRestAction<PagingObject<SavedShow>>
Get a list of shows saved in the current Spotify user’s library.
getSavedTracks
Link copied to clipboard
common
suspend fun getSavedTracks(limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market? = null): PagingObject<SavedTrack>
Get a list of the songs saved in the current Spotify user’s ‘Your Music’ library.
getSavedTracksRestAction
Link copied to clipboard
common
fun getSavedTracksRestAction(limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market? = null): SpotifyRestAction<PagingObject<SavedTrack>>
Get a list of the songs saved in the current Spotify user’s ‘Your Music’ library.
remove
Link copied to clipboard
common
suspend fun remove(type: LibraryType, vararg ids: String)
Remove one or more of the LibraryType (tracks or albums) from the current user’s ‘Your Music’ library.
suspend fun remove(type: LibraryType, id: String)
Remove one of LibraryType (track or album) from the current user’s ‘Your Music’ library.
removeRestAction
Link copied to clipboard
common
fun removeRestAction(type: LibraryType, vararg ids: String): SpotifyRestAction<Unit>
Remove one or more of the LibraryType (tracks or albums) from the current user’s ‘Your Music’ library.
fun removeRestAction(type: LibraryType, id: String): SpotifyRestAction<Unit>
Remove one of LibraryType (track or album) from the current user’s ‘Your Music’ library.

Properties

api
Link copied to clipboard
common
val api: GenericSpotifyApi
cache
Link copied to clipboard
common
val cache: SpotifyCache

Sources

common source
Link copied to clipboard