You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added suspend building
* Moved some code into common interface instead of reimplementing
the same stuff
* Specify the BuilderType for common SpotifyApi
* Make SpotifyApi sealed
* Added isTokenValid suspending function
require((clientId !=null&& clientSecret !=null&& redirectUri !=null) || authorization.token !=null|| authorization.tokenString !=null) { "You need to specify a valid clientId, clientSecret, and redirectUri in the credentials block!" }
require(clientId !=null&& clientSecret !=null&& redirectUri !=null) { "You need to specify a valid clientId, clientSecret, and redirectUri in the credentials block!" }
249
253
250
254
val response = executeTokenRequest(
@@ -278,7 +282,6 @@ class SpotifyClientApiBuilder(
278
282
} catch (e:Exception) {
279
283
throwSpotifyAuthenticationException("Invalid credentials provided in the login process", e)
280
284
}
281
-
}
282
285
authorization.token !=null->SpotifyClientApi(
283
286
clientId,
284
287
clientSecret,
@@ -315,49 +318,19 @@ class SpotifyClientApiBuilder(
* Build a public [SpotifyAppApi] using the provided credentials
359
332
*/
360
-
overridefunbuild(): SpotifyApi {
333
+
overridesuspendfunsuspendBuild(): SpotifyAppApi {
361
334
val clientId = credentials.clientId
362
335
val clientSecret = credentials.clientSecret
363
336
require((clientId !=null&& clientSecret !=null) || authorization.token !=null|| authorization.tokenString !=null) { "You didn't specify a client id or client secret in the credentials block!" }
* These endpoints allow for viewing and controlling user playback. Please view [the official documentation](https://developer.spotify.com/web-api/working-with-connect/)
35
35
* for more information on how this works. This is in beta and is available for **premium users only**. Endpoints are **not** guaranteed to work
0 commit comments