Skip to content

Commit 6f4dc31

Browse files
committed
lint, add cached_responses.json
1 parent a2293d1 commit 6f4dc31

File tree

114 files changed

+1317
-928
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1317
-928
lines changed

src/androidMain/kotlin/com/adamratzman/spotify/auth/SpotifyDefaultCredentialStore.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2021; Original author: Adam Ratzman */
1+
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2022; Original author: Adam Ratzman */
22
package com.adamratzman.spotify.auth
33

44
import android.annotation.SuppressLint
@@ -93,8 +93,11 @@ public class SpotifyDefaultCredentialStore(
9393
return if (expiry == -1L) null else expiry
9494
}
9595
set(value) {
96-
if (value == null) encryptedPreferences.edit().remove(SpotifyTokenExpiryKey).apply()
97-
else encryptedPreferences.edit().putLong(SpotifyTokenExpiryKey, value).apply()
96+
if (value == null) {
97+
encryptedPreferences.edit().remove(SpotifyTokenExpiryKey).apply()
98+
} else {
99+
encryptedPreferences.edit().putLong(SpotifyTokenExpiryKey, value).apply()
100+
}
98101
}
99102

100103
/**
@@ -186,7 +189,9 @@ public class SpotifyDefaultCredentialStore(
186189
spotifyToken = newToken
187190
newToken
188191
}
189-
} else return null
192+
} else {
193+
return null
194+
}
190195

191196
return runBlocking {
192197
spotifyClientPkceApi(

src/androidMain/kotlin/com/adamratzman/spotify/auth/implicit/AbstractSpotifyAppCompatImplicitLoginActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2021; Original author: Adam Ratzman */
1+
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2022; Original author: Adam Ratzman */
22
package com.adamratzman.spotify.auth.implicit
33

44
import android.app.Activity

src/androidMain/kotlin/com/adamratzman/spotify/auth/implicit/AbstractSpotifyAppImplicitLoginActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2021; Original author: Adam Ratzman */
1+
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2022; Original author: Adam Ratzman */
22
package com.adamratzman.spotify.auth.implicit
33

44
import android.app.Activity

src/androidMain/kotlin/com/adamratzman/spotify/auth/implicit/ImplicitAuthUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2021; Original author: Adam Ratzman */
1+
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2022; Original author: Adam Ratzman */
22
package com.adamratzman.spotify.auth.implicit
33

44
import android.app.Activity

src/androidMain/kotlin/com/adamratzman/spotify/auth/implicit/SpotifyImplicitLoginActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2021; Original author: Adam Ratzman */
1+
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2022; Original author: Adam Ratzman */
22
package com.adamratzman.spotify.auth.implicit
33

44
import android.app.Activity

src/androidMain/kotlin/com/adamratzman/spotify/auth/pkce/AbstractSpotifyPkceLoginActivity.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2021; Original author: Adam Ratzman */
1+
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2022; Original author: Adam Ratzman */
22
package com.adamratzman.spotify.auth.pkce
33

44
import android.content.Intent
@@ -21,8 +21,8 @@ import com.adamratzman.spotify.getSpotifyPkceCodeChallenge
2121
import com.adamratzman.spotify.spotifyClientPkceApi
2222
import com.adamratzman.spotify.utils.logToConsole
2323
import com.spotify.sdk.android.auth.AuthorizationResponse
24-
import kotlin.random.Random
2524
import kotlinx.coroutines.runBlocking
25+
import kotlin.random.Random
2626

2727
/**
2828
* This class hooks into spotify-web-api-kotlin to provide PKCE authorization for Android application. Paired with [SpotifyDefaultCredentialStore] to easily store credentials.
@@ -142,7 +142,6 @@ public abstract class AbstractSpotifyPkceLoginActivity : AppCompatActivity() {
142142
IllegalStateException("Authorization code was null or blank.")
143143
)
144144
} else {
145-
146145
try {
147146
logToConsole("Building client PKCE api...")
148147
setProgressBarVisible()

src/androidMain/kotlin/com/adamratzman/spotify/auth/pkce/PkceAuthUtils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2021; Original author: Adam Ratzman */
1+
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2022; Original author: Adam Ratzman */
22
package com.adamratzman.spotify.auth.pkce
33

44
import android.app.Activity
@@ -8,7 +8,7 @@ import androidx.annotation.RequiresApi
88

99
public fun Intent?.isSpotifyPkceAuthIntent(redirectUri: String): Boolean {
1010
return this != null &&
11-
(dataString?.startsWith("$redirectUri/?code=") == true || dataString?.startsWith("$redirectUri/?error=") == true)
11+
(dataString?.startsWith("$redirectUri/?code=") == true || dataString?.startsWith("$redirectUri/?error=") == true)
1212
}
1313

1414
/**

src/androidMain/kotlin/com/adamratzman/spotify/notifications/AbstractSpotifyBroadcastReceiver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2021; Original author: Adam Ratzman */
1+
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2022; Original author: Adam Ratzman */
22
package com.adamratzman.spotify.notifications
33

44
import android.content.BroadcastReceiver

src/androidMain/kotlin/com/adamratzman/spotify/notifications/SpotifyBroadcastReceiverUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2021; Original author: Adam Ratzman */
1+
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2022; Original author: Adam Ratzman */
22
package com.adamratzman.spotify.notifications
33

44
import android.app.Activity

src/androidMain/kotlin/com/adamratzman/spotify/utils/PlatformUtils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2021; Original author: Adam Ratzman */
1+
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2022; Original author: Adam Ratzman */
22
package com.adamratzman.spotify.utils
33

44
import android.app.Activity
55
import android.content.Context
66
import android.util.Log
77
import android.widget.Toast
8-
import java.net.URLEncoder
98
import kotlinx.coroutines.runBlocking
9+
import java.net.URLEncoder
1010

1111
internal actual fun String.encodeUrl() = URLEncoder.encode(this, "UTF-8")!!
1212

0 commit comments

Comments
 (0)