@@ -59,7 +59,7 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
59
59
*
60
60
* @return The created [Playlist] object with no tracks
61
61
*/
62
- fun createPlaylist (
62
+ fun createClientPlaylist (
63
63
name : String ,
64
64
description : String? = null,
65
65
public : Boolean? = null,
@@ -95,8 +95,8 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
95
95
* @throws BadRequestException if any invalid track ids is provided or the playlist is not found
96
96
*/
97
97
98
- fun addTrackToPlaylist (playlist : String , track : String , position : Int? = null) =
99
- addTracksToPlaylist (playlist, track, position = position)
98
+ fun addTrackToClientPlaylist (playlist : String , track : String , position : Int? = null) =
99
+ addTracksToClientPlaylist (playlist, track, position = position)
100
100
101
101
/* *
102
102
* Add one or more tracks to a user’s playlist.
@@ -112,7 +112,7 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
112
112
*
113
113
* @throws BadRequestException if any invalid track ids is provided or the playlist is not found
114
114
*/
115
- fun addTracksToPlaylist (playlist : String , vararg tracks : String , position : Int? = null): SpotifyRestAction <Unit > {
115
+ fun addTracksToClientPlaylist (playlist : String , vararg tracks : String , position : Int? = null): SpotifyRestAction <Unit > {
116
116
val body = jsonMap()
117
117
body + = json { " uris" to JsonArray (tracks.map { TrackUri (TrackUri (it).id.encodeUrl()).uri }.map(::JsonPrimitive )) }
118
118
if (position != null ) body + = json { " position" to position }
@@ -139,7 +139,7 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
139
139
*
140
140
* @throws BadRequestException if the playlist is not found or parameters exceed the max length
141
141
*/
142
- fun changePlaylistDetails (
142
+ fun changeClientPlaylistDetails (
143
143
playlist : String ,
144
144
name : String? = null,
145
145
public : Boolean? = null,
@@ -172,7 +172,7 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
172
172
*
173
173
* @throws BadRequestException if the filters provided are illegal
174
174
*/
175
- fun getPlaylists (
175
+ fun getClientPlaylists (
176
176
limit : Int? = null,
177
177
offset : Int? = null
178
178
): SpotifyRestActionPaging <SimplePlaylist , PagingObject <SimplePlaylist >> {
@@ -185,7 +185,7 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
185
185
}
186
186
187
187
/* *
188
- * Find a client playlist by its id. If you want to find multiple playlists, consider using [getPlaylists ]
188
+ * Find a client playlist by its id. If you want to find multiple playlists, consider using [getClientPlaylists ]
189
189
*
190
190
* **Note that** private playlists are only retrievable for the current user and require the [SpotifyScope.PLAYLIST_READ_PRIVATE] scope
191
191
* to have been authorized by the user. Note that this scope alone will not return a collaborative playlist, even
@@ -197,9 +197,9 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
197
197
*
198
198
* @return A possibly-null [SimplePlaylist] if the playlist doesn't exist
199
199
*/
200
- fun getPlaylist (id : String ): SpotifyRestAction <SimplePlaylist ?> {
200
+ fun getClientPlaylist (id : String ): SpotifyRestAction <SimplePlaylist ?> {
201
201
return toAction {
202
- val playlists = getPlaylists ().complete()
202
+ val playlists = getClientPlaylists ().complete()
203
203
playlists.items.find { it.id == id } ? : playlists.getAllItems().complete().find { it.id == id }
204
204
}
205
205
}
@@ -211,7 +211,7 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
211
211
*
212
212
* @param playlist playlist id
213
213
*/
214
- fun deletePlaylist (playlist : String ): SpotifyRestAction <Unit > {
214
+ fun deleteClientPlaylist (playlist : String ): SpotifyRestAction <Unit > {
215
215
return (api as SpotifyClientApi ).following.unfollowPlaylist(PlaylistUri (playlist).id)
216
216
}
217
217
@@ -235,7 +235,7 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
235
235
*
236
236
* @throws BadRequestException if the playlist is not found or illegal filters are applied
237
237
*/
238
- fun reorderPlaylistTracks (
238
+ fun reorderClientPlaylistTracks (
239
239
playlist : String ,
240
240
reorderRangeStart : Int ,
241
241
reorderRangeLength : Int? = null,
@@ -267,7 +267,7 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
267
267
*
268
268
* @throws BadRequestException if playlist is not found or illegal tracks are provided
269
269
*/
270
- fun setPlaylistTracks (playlist : String , vararg tracks : String ): SpotifyRestAction <Unit > {
270
+ fun setClientPlaylistTracks (playlist : String , vararg tracks : String ): SpotifyRestAction <Unit > {
271
271
return toAction {
272
272
val body = jsonMap()
273
273
body + = json { " uris" to JsonArray (tracks.map { TrackUri (TrackUri (it).id.encodeUrl()).uri }.map(::JsonPrimitive )) }
@@ -291,14 +291,14 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
291
291
*
292
292
* @throws BadRequestException if playlist is not found or illegal tracks are provided
293
293
*/
294
- fun replacePlaylistTracks (playlist : String , vararg tracks : String ) = setPlaylistTracks (playlist, * tracks)
294
+ fun replaceClientPlaylistTracks (playlist : String , vararg tracks : String ) = setClientPlaylistTracks (playlist, * tracks)
295
295
296
296
/* *
297
297
* Remove all the tracks in a playlist
298
298
* @param playlist the spotify id or uri for the playlist.
299
299
*/
300
- fun removeAllPlaylistTracks (playlist : String ): SpotifyRestAction <Unit > {
301
- return setPlaylistTracks (playlist)
300
+ fun removeAllClientPlaylistTracks (playlist : String ): SpotifyRestAction <Unit > {
301
+ return setClientPlaylistTracks (playlist)
302
302
}
303
303
304
304
/* *
@@ -322,7 +322,7 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
322
322
* @throws IIOException if the image is not found
323
323
* @throws BadRequestException if invalid data is provided
324
324
*/
325
- fun uploadPlaylistCover (
325
+ fun uploadClientPlaylistCover (
326
326
playlist : String ,
327
327
imagePath : String? = null,
328
328
imageFile : File ? = null,
@@ -357,12 +357,12 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
357
357
* @param positions The positions at which the track is located in the playlist
358
358
* @param snapshotId The playlist snapshot against which to apply this action. **recommended to have**
359
359
*/
360
- fun removeTrackFromPlaylist (
360
+ fun removeTrackFromClientPlaylist (
361
361
playlist : String ,
362
362
track : String ,
363
363
positions : SpotifyTrackPositions ,
364
364
snapshotId : String? = null
365
- ) = removeTracksFromPlaylist (playlist, track to positions, snapshotId = snapshotId)
365
+ ) = removeTracksFromClientPlaylist (playlist, track to positions, snapshotId = snapshotId)
366
366
367
367
/* *
368
368
* Remove all occurrences of a track from the specified playlist.
@@ -374,11 +374,11 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
374
374
* @param track The track id
375
375
* @param snapshotId The playlist snapshot against which to apply this action. **recommended to have**
376
376
*/
377
- fun removeTrackFromPlaylist (
377
+ fun removeTrackFromClientPlaylist (
378
378
playlist : String ,
379
379
track : String ,
380
380
snapshotId : String? = null
381
- ) = removeTracksFromPlaylist (playlist, track, snapshotId = snapshotId)
381
+ ) = removeTracksFromClientPlaylist (playlist, track, snapshotId = snapshotId)
382
382
383
383
/* *
384
384
* Remove all occurrences of the specified tracks from the given playlist.
@@ -390,7 +390,7 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
390
390
* @param tracks An array of track ids
391
391
* @param snapshotId The playlist snapshot against which to apply this action. **recommended to have**
392
392
*/
393
- fun removeTracksFromPlaylist (
393
+ fun removeTracksFromClientPlaylist (
394
394
playlist : String ,
395
395
vararg tracks : String ,
396
396
snapshotId : String? = null
@@ -406,7 +406,7 @@ class ClientPlaylistApi(api: SpotifyApi<*, *>) : PlaylistApi(api) {
406
406
* @param tracks An array of [Pair]s of track ids *and* track positions (zero-based)
407
407
* @param snapshotId The playlist snapshot against which to apply this action. **recommended to have**
408
408
*/
409
- fun removeTracksFromPlaylist (
409
+ fun removeTracksFromClientPlaylist (
410
410
playlist : String ,
411
411
vararg tracks : Pair <String , SpotifyTrackPositions >,
412
412
snapshotId : String? = null
0 commit comments