Skip to content

Commit f623419

Browse files
committed
fix to uri parser
1 parent 232407a commit f623419

38 files changed

+338
-295
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ If you have a question, you can:
6767

6868
## Creating a new api instance
6969
To decide which api you need (SpotifyAppApi, SpotifyClientApi, SpotifyImplicitGrantApi), please refer to
70-
https://developer.com.adamratzman.spotify.com/documentation/general/guides/authorization-guide/. In general:
70+
https://developer.spotify.com/documentation/general/guides/authorization-guide/. In general:
7171
- If you don't need client resources, use SpotifyAppApi
7272
- If you're using the api in a backend application, use SpotifyClientApi
7373
- If you're using the api in a frontend application, use SpotifyImplicitGrantApi

samples/jvm/src/main/kotlin/appApi/AlbumApiSample.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ fun main() {
1111
).build()
1212

1313
// get album "Kids in Love" by the Mowgli's release date
14-
println(api.albums.getAlbum("com.adamratzman.spotify:album:4M2p2BIRHIeBu8Ew9IBQ0s").complete()!!.releaseDate)
14+
println(api.albums.getAlbum("spotify:album:4M2p2BIRHIeBu8Ew9IBQ0s").complete()!!.releaseDate)
1515

1616
// get album "Kids in Love" and a non-existant album
17-
println(api.albums.getAlbums("com.adamratzman.spotify:album:4M2p2BIRHIeBu8Ew9IBQ0s", "nonexistantalbum"))
17+
println(api.albums.getAlbums("spotify:album:4M2p2BIRHIeBu8Ew9IBQ0s", "nonexistantalbum"))
1818

1919
// get album "Kids in Love"'s tracks
20-
println(api.albums.getAlbumTracks("com.adamratzman.spotify:album:4M2p2BIRHIeBu8Ew9IBQ0s").complete().filterNotNull().map { it.name })
20+
println(api.albums.getAlbumTracks("spotify:album:4M2p2BIRHIeBu8Ew9IBQ0s").complete().filterNotNull().map { it.name })
2121
}

samples/jvm/src/main/kotlin/appApi/ArtistApiSample.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ fun main() {
1111
).build()
1212

1313
// get artist Cody G's total follower count
14-
println(api.artists.getArtist("com.adamratzman.spotify:artist:26HkLAAIMh5qOFet57d1rg").complete()!!.followers.total)
14+
println(api.artists.getArtist("spotify:artist:26HkLAAIMh5qOFet57d1rg").complete()!!.followers.total)
1515

1616
// get artist Cody G and a non-existant artist
17-
println(api.artists.getArtists("com.adamratzman.spotify:artist:26HkLAAIMh5qOFet57d1rg", "nonexistantartist"))
17+
println(api.artists.getArtists("spotify:artist:26HkLAAIMh5qOFet57d1rg", "nonexistantartist"))
1818

1919
// get all of artist Cody G's albums
20-
println(api.artists.getArtistAlbums("com.adamratzman.spotify:artist:26HkLAAIMh5qOFet57d1rg").getAllItems().complete().filterNotNull().map { it.name })
20+
println(api.artists.getArtistAlbums("spotify:artist:26HkLAAIMh5qOFet57d1rg").getAllItems().complete().filterNotNull().map { it.name })
2121

2222
// get Cody G's top tracks, in descending order, in France
23-
println(api.artists.getArtistTopTracks("com.adamratzman.spotify:artist:26HkLAAIMh5qOFet57d1rg").complete().map { it.name })
23+
println(api.artists.getArtistTopTracks("spotify:artist:26HkLAAIMh5qOFet57d1rg").complete().map { it.name })
2424

2525
// get Cody G's related artists
26-
println(api.artists.getRelatedArtists("com.adamratzman.spotify:artist:26HkLAAIMh5qOFet57d1rg").complete().map { it.name })
26+
println(api.artists.getRelatedArtists("spotify:artist:26HkLAAIMh5qOFet57d1rg").complete().map { it.name })
2727
}

samples/jvm/src/main/kotlin/appApi/BrowseApiSample.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fun main() {
3939

4040
// get and print recommendation seeds and tracks
4141
val recommendationResponse = api.browse.getTrackRecommendations(
42-
seedTracks = listOf("com.adamratzman.spotify:track:2LYAG9jlH9rul11nalRxR0"),
42+
seedTracks = listOf("spotify:track:2LYAG9jlH9rul11nalRxR0"),
4343
seedGenres = listOf("indie-pop"),
4444
minAttributes = listOf(TrackAttribute.create(TuneableTrackAttribute.Danceability, 0.6f))
4545
).complete()

samples/jvm/src/main/kotlin/appApi/FollowingApiSample.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ fun main() {
1111
).build()
1212

1313
// check if adamratzman and adamratzman1 are following "Hit Rewind"
14-
println(api.following.areFollowingPlaylist("com.adamratzman.spotify:playlist:37i9dQZF1DX0s5kDXi1oC5", "adamratzman", "adamratzman1"))
14+
println(api.following.areFollowingPlaylist("spotify:playlist:37i9dQZF1DX0s5kDXi1oC5", "adamratzman", "adamratzman1"))
1515

1616
// check if adamratzman1 is following "Hit Rewind"
17-
println(api.following.isFollowingPlaylist("com.adamratzman.spotify:playlist:37i9dQZF1DX0s5kDXi1oC5", "adamratzman1"))
17+
println(api.following.isFollowingPlaylist("spotify:playlist:37i9dQZF1DX0s5kDXi1oC5", "adamratzman1"))
1818
}

samples/jvm/src/main/kotlin/appApi/PlaylistApiSample.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ fun main() {
1616
println(api.playlists.getUserPlaylists("adamratzman1").getAllItems().complete().filterNotNull().map { it.name })
1717

1818
// get playlist "Hit Rewind"'s description in Andorra's market
19-
println(api.playlists.getPlaylist("com.adamratzman.spotify:playlist:37i9dQZF1DX0s5kDXi1oC5", Market.AD).complete()!!.description)
19+
println(api.playlists.getPlaylist("spotify:playlist:37i9dQZF1DX0s5kDXi1oC5", Market.AD).complete()!!.description)
2020

2121
// get up to 20 tracks for playlist "Hit Rewind"
22-
println(api.playlists.getPlaylistTracks("com.adamratzman.spotify:playlist:37i9dQZF1DX0s5kDXi1oC5").complete().items.map { (it.track as Track).name })
22+
println(api.playlists.getPlaylistTracks("spotify:playlist:37i9dQZF1DX0s5kDXi1oC5").complete().items.map { (it.track as Track).name })
2323

2424
// get playlist covers for "Hit Rewind"
25-
println(api.playlists.getPlaylistCovers("com.adamratzman.spotify:playlist:37i9dQZF1DX0s5kDXi1oC5").complete())
25+
println(api.playlists.getPlaylistCovers("spotify:playlist:37i9dQZF1DX0s5kDXi1oC5").complete())
2626
}

samples/jvm/src/main/kotlin/appApi/TrackApiSample.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ fun main() {
1111
).build()
1212

1313
// get track "I'm Good" by the Mowgli's and check its popularity
14-
println(api.tracks.getTrack("com.adamratzman.spotify:track:5KQDGl3vAkNGyfvSbaW89E").complete()!!.popularity)
14+
println(api.tracks.getTrack("spotify:track:5KQDGl3vAkNGyfvSbaW89E").complete()!!.popularity)
1515

1616
// get track "I'm Good" and a non-existant track
17-
println(api.tracks.getTracks("com.adamratzman.spotify:track:5KQDGl3vAkNGyfvSbaW89E", "nonexistanttrack").complete())
17+
println(api.tracks.getTracks("spotify:track:5KQDGl3vAkNGyfvSbaW89E", "nonexistanttrack").complete())
1818

1919
// get audio analysis for track "I'm Good"
20-
println(api.tracks.getAudioAnalysis("com.adamratzman.spotify:track:5KQDGl3vAkNGyfvSbaW89E").complete())
20+
println(api.tracks.getAudioAnalysis("spotify:track:5KQDGl3vAkNGyfvSbaW89E").complete())
2121

2222
// get audio features for track "I'm Good"
23-
println(api.tracks.getAudioFeatures("com.adamratzman.spotify:track:5KQDGl3vAkNGyfvSbaW89E").complete())
23+
println(api.tracks.getAudioFeatures("spotify:track:5KQDGl3vAkNGyfvSbaW89E").complete())
2424

2525
// get audio features for an existing and non-existant track
26-
println(api.tracks.getAudioFeatures("com.adamratzman.spotify:track:5KQDGl3vAkNGyfvSbaW89E", "nonexistanttrack"))
26+
println(api.tracks.getAudioFeatures("spotify:track:5KQDGl3vAkNGyfvSbaW89E", "nonexistanttrack"))
2727
}

samples/jvm/src/main/kotlin/clientApi/ClientFollowingApiSample.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,25 @@ fun main() {
1616
.build()
1717

1818
// see if you're following playlist "I'm Good Radio"
19-
println(api.following.isFollowingPlaylist("com.adamratzman.spotify:playlist:37i9dQZF1E8L0j2hm3kP31").complete())
19+
println(api.following.isFollowingPlaylist("spotify:playlist:37i9dQZF1E8L0j2hm3kP31").complete())
2020

2121
// see if you're following users adamratzman1 and adamratzman
2222
println(api.following.isFollowingUsers("adamratzman1", "adamratzman").complete())
2323

2424
// see if you're following artist Louane
25-
println(api.following.isFollowingArtist("com.adamratzman.spotify:artist:7wjeXCtRND2ZdKfMJFu6JC").complete())
25+
println(api.following.isFollowingArtist("spotify:artist:7wjeXCtRND2ZdKfMJFu6JC").complete())
2626

2727
// get all followed artists, limiting 1 each request
2828
println(api.following.getFollowedArtists(limit = 1).getAllItems().complete())
2929

3030
// follow and unfollow, if you weren't previously following, the artist Louane
3131

32-
val isFollowingLouane = api.following.isFollowingArtist("com.adamratzman.spotify:artist:7wjeXCtRND2ZdKfMJFu6JC").complete()
32+
val isFollowingLouane = api.following.isFollowingArtist("spotify:artist:7wjeXCtRND2ZdKfMJFu6JC").complete()
3333

34-
if (isFollowingLouane) api.following.unfollowArtist("com.adamratzman.spotify:artist:7wjeXCtRND2ZdKfMJFu6JC").complete()
35-
api.following.followArtist("com.adamratzman.spotify:artist:7wjeXCtRND2ZdKfMJFu6JC").complete()
34+
if (isFollowingLouane) api.following.unfollowArtist("spotify:artist:7wjeXCtRND2ZdKfMJFu6JC").complete()
35+
api.following.followArtist("spotify:artist:7wjeXCtRND2ZdKfMJFu6JC").complete()
3636

37-
if (!isFollowingLouane) api.following.unfollowArtist("com.adamratzman.spotify:artist:7wjeXCtRND2ZdKfMJFu6JC").complete()
37+
if (!isFollowingLouane) api.following.unfollowArtist("spotify:artist:7wjeXCtRND2ZdKfMJFu6JC").complete()
3838

3939
// follow and unfollow, if you weren't previously following, the user adamratzman1
4040

@@ -47,10 +47,10 @@ fun main() {
4747

4848
// follow and unfollow, if you weren't previously following, the playlist Today's Top Hits
4949

50-
val isFollowingTodaysTopHits = api.following.isFollowingPlaylist("com.adamratzman.spotify:playlist:37i9dQZF1DXcBWIGoYBM5M").complete()
50+
val isFollowingTodaysTopHits = api.following.isFollowingPlaylist("spotify:playlist:37i9dQZF1DXcBWIGoYBM5M").complete()
5151

52-
if (isFollowingTodaysTopHits) api.following.unfollowPlaylist("com.adamratzman.spotify:playlist:37i9dQZF1DXcBWIGoYBM5M").complete()
53-
api.following.followPlaylist("com.adamratzman.spotify:playlist:37i9dQZF1DXcBWIGoYBM5M").complete()
52+
if (isFollowingTodaysTopHits) api.following.unfollowPlaylist("spotify:playlist:37i9dQZF1DXcBWIGoYBM5M").complete()
53+
api.following.followPlaylist("spotify:playlist:37i9dQZF1DXcBWIGoYBM5M").complete()
5454

55-
if (!isFollowingTodaysTopHits) api.following.unfollowPlaylist("com.adamratzman.spotify:playlist:37i9dQZF1DXcBWIGoYBM5M").complete()
55+
if (!isFollowingTodaysTopHits) api.following.unfollowPlaylist("spotify:playlist:37i9dQZF1DXcBWIGoYBM5M").complete()
5656
}

samples/jvm/src/main/kotlin/clientApi/ClientLibraryApiSample.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ fun main() {
2424
println(api.library.contains(TRACK, api.search.searchTrack("I'm Good the Mowgli's").complete()[0].id).complete())
2525

2626
// add and remove track "Up" by Nav
27-
api.library.add(TRACK, "com.adamratzman.spotify:track:5qbcsZMwL0x46sX7VO37Ye").complete()
28-
api.library.remove(TRACK, "com.adamratzman.spotify:track:5qbcsZMwL0x46sX7VO37Ye").complete()
27+
api.library.add(TRACK, "spotify:track:5qbcsZMwL0x46sX7VO37Ye").complete()
28+
api.library.remove(TRACK, "spotify:track:5qbcsZMwL0x46sX7VO37Ye").complete()
2929
}

samples/jvm/src/main/kotlin/clientApi/ClientPlaylistApiSample.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fun main() {
2323
println(playlist)
2424

2525
// add "Reflections" by MisterWives to the end of your newly-created playlist
26-
api.playlists.addTrackToClientPlaylist(playlist.id, "com.adamratzman.spotify:track:2PtBhfoPZ6VYtXkrE5FrCH").complete()
26+
api.playlists.addTrackToClientPlaylist(playlist.id, "spotify:track:2PtBhfoPZ6VYtXkrE5FrCH").complete()
2727

2828
// change the playlist description to "My awesome playlist"
2929
api.playlists.changeClientPlaylistDetails(playlist.id, description = "My awesome playlist").complete()
@@ -38,10 +38,10 @@ fun main() {
3838
// for an example of re-ordering tracks
3939

4040
// replace the tracks in a client playlist with two songs by Lorde
41-
api.playlists.setClientPlaylistTracks(playlist.id, "com.adamratzman.spotify:track:6ie2Bw3xLj2JcGowOlcMhb", "com.adamratzman.spotify:track:2dLLR6qlu5UJ5gk0dKz0h3").complete()
41+
api.playlists.setClientPlaylistTracks(playlist.id, "spotify:track:6ie2Bw3xLj2JcGowOlcMhb", "spotify:track:2dLLR6qlu5UJ5gk0dKz0h3").complete()
4242

4343
// remove the song we just added from our client playlist
44-
api.playlists.removeTrackFromClientPlaylist(playlist.id, "com.adamratzman.spotify:track:6ie2Bw3xLj2JcGowOlcMhb").complete()
44+
api.playlists.removeTrackFromClientPlaylist(playlist.id, "spotify:track:6ie2Bw3xLj2JcGowOlcMhb").complete()
4545

4646
// remove all playlist tracks
4747
api.playlists.removeAllClientPlaylistTracks(playlist.id)

0 commit comments

Comments
 (0)