When a submit fails for a transient reason (no connection, bad gateway, server error, rate limit) the scrobble is saved to a Room table and a network-constrained WorkManager job sends it later, in batches of 50, oldest first. Plays too old for the server are dropped, and a rejected session or unexpected error leaves the queue untouched. Safe to retry as the server dedupes on (user, played_at, artist, track). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
67 lines
2.0 KiB
Kotlin
67 lines
2.0 KiB
Kotlin
plugins {
|
|
alias(libs.plugins.android.application)
|
|
alias(libs.plugins.kotlin.compose)
|
|
alias(libs.plugins.kotlin.serialization)
|
|
alias(libs.plugins.ksp)
|
|
}
|
|
|
|
android {
|
|
namespace = "dev.daubney.scrobbled"
|
|
compileSdk {
|
|
version = release(37)
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId = "dev.daubney.scrobbled"
|
|
minSdk = 29
|
|
targetSdk = 37
|
|
versionCode = 1
|
|
versionName = "1.0"
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
optimization {
|
|
enable = true
|
|
packageScope = setOf("androidx.**", "kotlin.**", "kotlinx.**")
|
|
}
|
|
}
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(libs.androidx.core.ktx)
|
|
implementation(libs.androidx.activity.compose)
|
|
implementation(libs.androidx.lifecycle.runtime.compose)
|
|
implementation(libs.androidx.lifecycle.viewmodel.compose)
|
|
implementation(platform(libs.androidx.compose.bom))
|
|
implementation(libs.androidx.compose.ui)
|
|
implementation(libs.androidx.compose.ui.tooling.preview)
|
|
implementation(libs.androidx.compose.material3)
|
|
implementation(libs.androidx.navigation.compose)
|
|
implementation(libs.okhttp)
|
|
implementation(libs.kotlinx.serialization.json)
|
|
implementation(libs.kotlinx.coroutines.core)
|
|
implementation(libs.androidx.room.runtime)
|
|
implementation(libs.androidx.room.ktx)
|
|
ksp(libs.androidx.room.compiler)
|
|
implementation(libs.androidx.work.runtime.ktx)
|
|
debugImplementation(libs.androidx.compose.ui.tooling)
|
|
testImplementation(libs.junit)
|
|
testImplementation(libs.androidx.work.testing)
|
|
testImplementation(libs.okhttp.mockwebserver)
|
|
testImplementation(libs.kotlinx.coroutines.test)
|
|
androidTestImplementation(libs.androidx.espresso.core)
|
|
androidTestImplementation(libs.androidx.junit)
|
|
}
|