Skip to content

Commit 8818354

Browse files
committed
add documentation to warn users about #13 - fix for now
1 parent c6788b4 commit 8818354

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/main/kotlin/com/adamratzman/spotify/endpoints/public/PlaylistsAPI.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ import java.util.function.Supplier
1010
*/
1111
open class PlaylistsAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
1212
/**
13-
* Get a list of the playlists owned or followed by a Spotify user.
13+
* Get a list of the playlists owned or followed by a Spotify user. Lookups for non-existant users return empty [PagingObject]s
14+
* (blame Spotify)
1415
*
1516
* @param userId The user’s Spotify user ID.
1617
* @param limit The number of album objects to return. Default: 20. Minimum: 1. Maximum: 50.
1718
* @param offset The index of the first album to return. Default: 0 (i.e., the first album). Use with limit to get the next set of albums.
1819
*
19-
* @return [PagingObject] of [SimplePlaylist]s. This does not have the detail of full [Playlist] objects.
20+
* @return [PagingObject] of [SimplePlaylist]s **ONLY if** the user can be found. Otherwise, an empty paging object is returned.
21+
* This does not have the detail of full [Playlist] objects.
2022
*
21-
* @throws BadRequestException if the [userId] cannot be found
2223
*/
2324
fun getPlaylists(userId: String, limit: Int? = null, offset: Int? = null): SpotifyRestAction<PagingObject<SimplePlaylist>> {
2425
return toAction(Supplier {

src/test/kotlin/com/adamratzman/spotify/public/SearchAPITest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SearchAPITest : Spek({
2828
}
2929
describe("search playlist") {
3030
it("valid request") {
31-
assert(s.searchPlaylist("run2").complete().total > 0)
31+
assert(s.searchPlaylist("test").complete().total > 0)
3232
}
3333
it("invalid request") {
3434
assertThrows<BadRequestException> { s.searchPlaylist("").complete().total }

0 commit comments

Comments
 (0)