Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,7 @@ android {
}

composeCompiler {
// Applies Compose's strong skipping optimization (skip composables whose parameters
// haven't changed) in Debug builds as well, making dev-mode performance more
// representative of Release and reducing unnecessary recompositions during development.
featureFlags = setOf(
org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag.StrongSkipping
)
// StrongSkipping is now enabled by default.
}

baselineProfile {
Expand All @@ -163,6 +158,7 @@ ksp {
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21)
freeCompilerArgs.add("-Xannotation-default-target=param-property")

if (enableComposeCompilerReports) {
val buildDir = project.layout.buildDirectory.get().asFile.absolutePath
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/theveloper/pixelplay/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,6 @@ class MainActivity : ComponentActivity() {
val intent = Intent(this@MainActivity, com.theveloper.pixelplay.presentation.telegram.auth.TelegramLoginActivity::class.java)
startActivity(intent)
}
else -> {}
}
}
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AiPlaylistGenerator @Inject constructor(

// Get offline scored candidates to pass to LLM (much smaller context window than the whole library)
val samplingPool = when {
candidateSongs.isNullOrEmpty().not() -> candidateSongs ?: allSongs
candidateSongs.isNullOrEmpty().not() -> candidateSongs
else -> {
val rankedForPrompt = dailyMixManager.getTopCandidatesForAi(
allSongs = allSongs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class DeepSeekAiClient(private val apiKey: String) : AiClient {

try {
client.newCall(request).execute().use { response ->
val responseBody = response.body?.string()
val responseBody = response.body.string()

if (!response.isSuccessful) {
throw AiProviderSupport.createException(
Expand All @@ -98,22 +98,13 @@ class DeepSeekAiClient(private val apiKey: String) : AiClient {
)
}

val nonEmptyBody = responseBody
?: throw AiProviderSupport.createException(
providerName = "DeepSeek",
statusCode = response.code,
transportMessage = "Empty response body",
responseBody = null,
requestedModel = resolvedModel
)

val chatResponse = json.decodeFromString<ChatResponse>(nonEmptyBody)
val chatResponse = json.decodeFromString<ChatResponse>(responseBody)
chatResponse.choices.firstOrNull()?.message?.content
?: throw AiProviderSupport.createException(
providerName = "DeepSeek",
statusCode = response.code,
transportMessage = "Response had no content",
responseBody = nonEmptyBody,
responseBody = responseBody,
requestedModel = resolvedModel
)
}
Expand Down Expand Up @@ -143,7 +134,7 @@ class DeepSeekAiClient(private val apiKey: String) : AiClient {
return@withContext getDefaultModels()
}

val responseBody = response.body?.string() ?: return@withContext getDefaultModels()
val responseBody = response.body.string()
val modelsResponse = json.decodeFromString<ModelsResponse>(responseBody)
modelsResponse.data.map { it.id }
} catch (e: Exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class GenericOpenAiClient(

try {
client.newCall(request).execute().use { response ->
val responseBody = response.body?.string()
val responseBody = response.body.string()

if (!response.isSuccessful) {
throw AiProviderSupport.createException(
Expand All @@ -102,22 +102,13 @@ class GenericOpenAiClient(
)
}

val nonEmptyBody = responseBody
?: throw AiProviderSupport.createException(
providerName = providerName,
statusCode = response.code,
transportMessage = "Empty response body",
responseBody = null,
requestedModel = resolvedModel
)

val chatResponse = json.decodeFromString<ChatResponse>(nonEmptyBody)
val chatResponse = json.decodeFromString<ChatResponse>(responseBody)
chatResponse.choices.firstOrNull()?.message?.content
?: throw AiProviderSupport.createException(
providerName = providerName,
statusCode = response.code,
transportMessage = "Response had no content",
responseBody = nonEmptyBody,
responseBody = responseBody,
requestedModel = resolvedModel
)
}
Expand Down Expand Up @@ -147,7 +138,7 @@ class GenericOpenAiClient(
return@withContext listOf(defaultModelId)
}

val responseBody = response.body?.string() ?: return@withContext listOf(defaultModelId)
val responseBody = response.body.string()
val modelsResponse = json.decodeFromString<ModelsResponse>(responseBody)
modelsResponse.data.map { it.id }.filter {
!it.contains("whisper") && !it.contains("embed") && !it.contains("tts")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class GroqAiClient(private val apiKey: String) : AiClient {

try {
client.newCall(request).execute().use { response ->
val responseBody = response.body?.string()
val responseBody = response.body.string()

if (!response.isSuccessful) {
throw AiProviderSupport.createException(
Expand All @@ -94,22 +94,13 @@ class GroqAiClient(private val apiKey: String) : AiClient {
)
}

val nonEmptyBody = responseBody
?: throw AiProviderSupport.createException(
providerName = "Groq",
statusCode = response.code,
transportMessage = "Empty response body",
responseBody = null,
requestedModel = resolvedModel
)

val chatResponse = json.decodeFromString<ChatResponse>(nonEmptyBody)
val chatResponse = json.decodeFromString<ChatResponse>(responseBody)
chatResponse.choices.firstOrNull()?.message?.content
?: throw AiProviderSupport.createException(
providerName = "Groq",
statusCode = response.code,
transportMessage = "Response had no content",
responseBody = nonEmptyBody,
responseBody = responseBody,
requestedModel = resolvedModel
)
}
Expand Down Expand Up @@ -140,7 +131,7 @@ class GroqAiClient(private val apiKey: String) : AiClient {
return@withContext getDefaultModels()
}

val responseBody = response.body?.string() ?: return@withContext getDefaultModels()
val responseBody = response.body.string()
val modelsResponse = json.decodeFromString<ModelsResponse>(responseBody)
modelsResponse.data.map { it.id }.filter { !it.contains("whisper") }
} catch (e: Exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class MistralAiClient(private val apiKey: String) : AiClient {

try {
client.newCall(request).execute().use { response ->
val responseBody = response.body?.string()
val responseBody = response.body.string()

if (!response.isSuccessful) {
throw AiProviderSupport.createException(
Expand All @@ -94,22 +94,13 @@ class MistralAiClient(private val apiKey: String) : AiClient {
)
}

val nonEmptyBody = responseBody
?: throw AiProviderSupport.createException(
providerName = "Mistral",
statusCode = response.code,
transportMessage = "Empty response body",
responseBody = null,
requestedModel = resolvedModel
)

val chatResponse = json.decodeFromString<ChatResponse>(nonEmptyBody)
val chatResponse = json.decodeFromString<ChatResponse>(responseBody)
chatResponse.choices.firstOrNull()?.message?.content
?: throw AiProviderSupport.createException(
providerName = "Mistral",
statusCode = response.code,
transportMessage = "Response had no content",
responseBody = nonEmptyBody,
responseBody = responseBody,
requestedModel = resolvedModel
)
}
Expand Down Expand Up @@ -139,7 +130,7 @@ class MistralAiClient(private val apiKey: String) : AiClient {
return@withContext getDefaultModels()
}

val responseBody = response.body?.string() ?: return@withContext getDefaultModels()
val responseBody = response.body.string()
val modelsResponse = json.decodeFromString<ModelsResponse>(responseBody)
modelsResponse.data.map { it.id }
} catch (e: Exception) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("DEPRECATION")
package com.theveloper.pixelplay.data.equalizer

import android.media.audiofx.Equalizer
Expand All @@ -17,6 +18,7 @@ import javax.inject.Singleton
* Thread-safe: All effect operations run on the main thread.
* Crossfade compatible: Effects are attached to the audio session, not the player instance.
*/
@Suppress("DEPRECATION")
@Singleton
class EqualizerManager @Inject constructor() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class GDriveApiService @Inject constructor(
.build()

val response = okHttpClient.newCall(request).execute()
val responseBody = response.body?.string() ?: ""
val responseBody = response.body.string()
Timber.d("GDriveApi createFolder: code=${response.code}, body=${responseBody.take(200)}")

if (!response.isSuccessful) {
Expand Down Expand Up @@ -137,7 +137,7 @@ class GDriveApiService @Inject constructor(
.build()

val response = okHttpClient.newCall(request).execute()
val responseBody = response.body?.string() ?: ""
val responseBody = response.body.string()
Timber.d("GDriveApi exchangeAuthCode: code=${response.code}")

if (!response.isSuccessful) {
Expand Down Expand Up @@ -169,7 +169,7 @@ class GDriveApiService @Inject constructor(
.build()

val response = okHttpClient.newCall(request).execute()
val responseBody = response.body?.string() ?: ""
val responseBody = response.body.string()
Timber.d("GDriveApi refreshToken: code=${response.code}")

if (!response.isSuccessful) {
Expand All @@ -195,7 +195,7 @@ class GDriveApiService @Inject constructor(
.build()

val response = okHttpClient.newCall(request).execute()
val responseBody = response.body?.string() ?: ""
val responseBody = response.body.string()
Timber.d("GDriveApi GET ${url.take(80)}: code=${response.code}")

if (!response.isSuccessful) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("DEPRECATION")
package com.theveloper.pixelplay.data.gdrive

import android.content.Context
Expand Down Expand Up @@ -29,6 +30,7 @@ import kotlin.math.absoluteValue
import javax.inject.Inject
import javax.inject.Singleton

@Suppress("DEPRECATION")
@Singleton
class GDriveRepository @Inject constructor(
private val api: GDriveApiService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ class JellyfinCoilFetcher(
return null
}

val body = response.body ?: return null
val bytes = body.bytes()
val bytes = response.body.bytes()

if (bytes.isEmpty()) {
Timber.w("$TAG: Empty response body for $url")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ class NavidromeCoilFetcher(
return null
}

val body = response.body ?: return null
val bytes = body.bytes()
val bytes = response.body.bytes()

if (bytes.isEmpty()) {
Timber.w("$TAG: Empty response body for $url")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("DEPRECATION")
package com.theveloper.pixelplay.data.jellyfin

import android.content.Context
Expand Down Expand Up @@ -37,6 +38,7 @@ import javax.inject.Inject
import javax.inject.Singleton
import kotlin.math.absoluteValue

@Suppress("DEPRECATION")
@Singleton
class JellyfinRepository @Inject constructor(
private val api: JellyfinApiService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ class SongMetadataEditor(
header[2] == '3'.code.toByte() -> DetectedContainer.MP3
// MP3 frame sync (0xFFE... 11-bit sync word)
header[0] == 0xFF.toByte() &&
(header[1].toInt() and 0xE0) == 0xE0.toInt() -> DetectedContainer.MP3
(header[1].toInt() and 0xE0) == 0xE0 -> DetectedContainer.MP3
// "ftyp" at offset 4 → ISO BMFF (MP4/M4A)
bytesRead >= 8 &&
header[4] == 'f'.code.toByte() &&
Expand Down Expand Up @@ -1027,8 +1027,8 @@ class SongMetadataEditor(
} catch (e: Exception) {
Timber.tag(TAG).w(e, "VORBISJAVA: Could not close source Opus file")
}
if (tempFile?.exists() == true && tempFile?.delete() == false) {
Timber.tag(TAG).w("VORBISJAVA: Could not delete temp file ${tempFile?.absolutePath}")
if (tempFile != null && tempFile.exists() && tempFile.delete() == false) {
Timber.tag(TAG).w("VORBISJAVA: Could not delete temp file ${tempFile.absolutePath}")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("DEPRECATION")
package com.theveloper.pixelplay.data.navidrome

import android.content.Context
Expand Down Expand Up @@ -51,6 +52,7 @@ import androidx.core.content.edit
*
* Manages authentication, playlist synchronization, and song caching.
*/
@Suppress("DEPRECATION")
@Singleton
class NavidromeRepository @Inject constructor(
private val api: NavidromeApiService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("DEPRECATION")
package com.theveloper.pixelplay.data.netease

import android.content.Context
Expand Down Expand Up @@ -38,6 +39,7 @@ import kotlin.math.absoluteValue
import javax.inject.Inject
import javax.inject.Singleton

@Suppress("DEPRECATION")
@Singleton
class NeteaseRepository @Inject constructor(
private val api: NeteaseApiService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class JellyfinApiService @Inject constructor(
return@withContext Result.failure(Exception("HTTP ${response.code}: ${response.message}"))
}

val responseBody = response.body?.string() ?: ""
val responseBody = response.body.string()
val json = JSONObject(responseBody)
val accessToken = json.optString("AccessToken", "")
val userId = json.optJSONObject("User")?.optString("Id", "") ?: ""
Expand Down Expand Up @@ -138,7 +138,7 @@ class JellyfinApiService @Inject constructor(

okHttpClient.newCall(request).execute().use { response ->
val code = response.code
val body = response.body?.string() ?: ""
val body = response.body.string()

if (!response.isSuccessful) {
Timber.w("$TAG: <<< HTTP $code for $path")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class NavidromeApiService @Inject constructor(

okHttpClient.newCall(request).execute().use { response ->
val code = response.code
val body = response.body?.string() ?: ""
val body = response.body.string()

if (!response.isSuccessful) {
Timber.w("$TAG: <<< HTTP $code for $endpoint")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class NeteaseApiService @Inject constructor() {
okHttpClient.newCall(builder.build()).execute().use { resp ->
val code = resp.code
Timber.d("$TAG: <<< HTTP $code for $url")
val bytes = resp.body?.bytes() ?: throw IOException("Empty response body")
val bytes = resp.body.bytes()
val body = String(bytes, StandardCharsets.UTF_8)
Timber.d("$TAG: <<< body[${body.length}]: ${body.take(500)}")
return body
Expand Down
Loading
Loading