@@ -14,4 +14,46 @@ fun main() {
14
14
}
15
15
}.build()
16
16
17
+ // see if you're following playlist "I'm Good Radio"
18
+ println (api.following.isFollowingPlaylist(" spotify:playlist:37i9dQZF1E8L0j2hm3kP31" ).complete())
19
+
20
+ // see if you're following users adamratzman1 and adamratzman
21
+ println (api.following.isFollowingUsers(" adamratzman1" , " adamratzman" ).complete())
22
+
23
+ // see if you're following artist Louane
24
+ println (api.following.isFollowingArtist(" spotify:artist:7wjeXCtRND2ZdKfMJFu6JC" ).complete())
25
+
26
+ // get all followed artists, limiting 1 each request
27
+ println (api.following.getFollowedArtists(limit = 1 ).getAllItems().complete().map { it.name })
28
+
29
+
30
+ // follow and unfollow, if you weren't previously following, the artist Louane
31
+
32
+ val isFollowingLouane = api.following.isFollowingArtist(" spotify:artist:7wjeXCtRND2ZdKfMJFu6JC" ).complete()
33
+
34
+ if (isFollowingLouane) api.following.unfollowArtist(" spotify:artist:7wjeXCtRND2ZdKfMJFu6JC" ).complete()
35
+ api.following.followArtist(" spotify:artist:7wjeXCtRND2ZdKfMJFu6JC" ).complete()
36
+
37
+ if (! isFollowingLouane) api.following.unfollowArtist(" spotify:artist:7wjeXCtRND2ZdKfMJFu6JC" ).complete()
38
+
39
+
40
+ // follow and unfollow, if you weren't previously following, the user adamratzman1
41
+
42
+ val isFollowingAdam = api.following.isFollowingUser(" adamratzman1" ).complete()
43
+
44
+ if (isFollowingAdam) api.following.unfollowUser(" adamratzman1" ).complete()
45
+ api.following.followUser(" adamratzman1" ).complete()
46
+
47
+ if (! isFollowingAdam) api.following.unfollowUser(" adamratzman1" ).complete()
48
+
49
+
50
+ // follow and unfollow, if you weren't previously following, the playlist Today's Top Hits
51
+
52
+ val isFollowingTodaysTopHits = api.following.isFollowingPlaylist(" spotify:playlist:37i9dQZF1DXcBWIGoYBM5M" ).complete()
53
+
54
+ if (isFollowingTodaysTopHits) api.following.unfollowPlaylist(" spotify:playlist:37i9dQZF1DXcBWIGoYBM5M" ).complete()
55
+ api.following.followPlaylist(" spotify:playlist:37i9dQZF1DXcBWIGoYBM5M" ).complete()
56
+
57
+ if (! isFollowingTodaysTopHits) api.following.unfollowPlaylist(" spotify:playlist:37i9dQZF1DXcBWIGoYBM5M" ).complete()
58
+
17
59
}
0 commit comments