Skip to content

Commit

Permalink
Fix MP3s not playing
Browse files Browse the repository at this point in the history
  • Loading branch information
LuftVerbot committed Aug 24, 2024
1 parent 8a0205d commit 263d212
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ext/src/main/java/dev/brahmkshatriya/echo/extension/DeezerApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import kotlinx.serialization.json.buildJsonObject
import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.jsonPrimitive
import kotlinx.serialization.json.put
import kotlinx.serialization.json.putJsonArray
import kotlinx.serialization.json.putJsonObject
import okhttp3.Headers
import okhttp3.HttpUrl
Expand Down Expand Up @@ -316,19 +317,18 @@ class DeezerApi {
val requestBody = json.encodeToString(
buildJsonObject {
put("license_token", licenseToken)
put("media", buildJsonArray {
buildJsonObject {
putJsonArray("media") {
add(buildJsonObject {
put("type", "FULL")
put("formats", buildJsonArray {
buildJsonObject {
putJsonArray("formats") {
add(buildJsonObject {
put("cipher", "BF_CBC_STRIPE")
put("format", "MP3_MISC")
}
})
}
)
}
})
put("track_tokens", buildJsonArray { add(track.extras["TRACK_TOKEN"])})
})
}
putJsonArray("track_tokens") { add(track.extras["TRACK_TOKEN"]) }
}
).toRequestBody("application/json; charset=utf-8".toMediaType())

Expand Down

0 comments on commit 263d212

Please sign in to comment.