build: bump to 3.0.5

Bump the version to 3.0.5.
This commit is contained in:
Alexander Capehart
2023-04-16 17:30:51 -06:00
parent b031adabeb
commit e6b00b1025
7 changed files with 35 additions and 20 deletions
+2 -2
View File
@@ -20,8 +20,8 @@ android {
defaultConfig {
applicationId namespace
versionName "3.0.4"
versionCode 28
versionName "3.0.5"
versionCode 29
minSdk 21
targetSdk 33
@@ -369,7 +369,7 @@ class SortName(name: String, musicSettings: MusicSettings) : Comparable<SortName
init {
var sortName = name
if (musicSettings.intelligentSorting) {
sortName = sortName.replace(leadingPunctuation, "")
sortName = sortName.replace(LEADING_PUNCTUATION_REGEX, "")
sortName =
sortName.run {
@@ -382,7 +382,7 @@ class SortName(name: String, musicSettings: MusicSettings) : Comparable<SortName
}
// Zero pad all numbers to six digits for better sorting
sortName = sortName.replace(consecutiveDigits) { it.value.padStart(6, '0') }
sortName = sortName.replace(CONSECUTIVE_DIGITS_REGEX) { it.value.padStart(6, '0') }
}
collationKey = COLLATOR.getCollationKey(sortName)
@@ -407,8 +407,8 @@ class SortName(name: String, musicSettings: MusicSettings) : Comparable<SortName
private companion object {
val COLLATOR: Collator = Collator.getInstance().apply { strength = Collator.PRIMARY }
val leadingPunctuation: Regex = Regex("""^\p{Punct}+""")
val consecutiveDigits: Regex = Regex("""\d+""")
val LEADING_PUNCTUATION_REGEX = Regex("[^\\p{Punct}+]")
val CONSECUTIVE_DIGITS_REGEX = Regex("\\d+")
}
}
@@ -23,9 +23,11 @@ import android.content.Context
import android.content.pm.PackageManager
import android.os.Build
import androidx.core.content.ContextCompat
import kotlinx.coroutines.*
import java.util.LinkedList
import javax.inject.Inject
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.EmptyCoroutineContext
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.Channel
import org.oxycblt.auxio.BuildConfig
import org.oxycblt.auxio.music.*
@@ -37,8 +39,6 @@ import org.oxycblt.auxio.music.storage.MediaStoreExtractor
import org.oxycblt.auxio.util.logD
import org.oxycblt.auxio.util.logE
import org.oxycblt.auxio.util.logW
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.EmptyCoroutineContext
/**
* Core music loading state class.
@@ -394,14 +394,18 @@ constructor(
return libraryJob.await().getOrThrow()
}
private inline fun <R> CoroutineScope.tryAsync(context: CoroutineContext = EmptyCoroutineContext, crossinline block: suspend () -> R) = async(context) {
try {
Result.success(block())
} catch (e: Exception) {
Result.failure(e)
private inline fun <R> CoroutineScope.tryAsync(
context: CoroutineContext = EmptyCoroutineContext,
crossinline block: suspend () -> R
) =
async(context) {
try {
Result.success(block())
} catch (e: Exception) {
Result.failure(e)
}
}
}
/**
* Emit a new [Indexer.State.Indexing] state. This can be used to signal the current state of
* the music loading process to external code. Assumes that the callee has already checked if
@@ -98,8 +98,8 @@ constructor(
builder
.size(getSafeRemoteViewsImageSize(context, 10f))
.transformations(
SquareFrameTransform.INSTANCE,
RoundedCornersTransformation(cornerRadius.toFloat()))
SquareFrameTransform.INSTANCE,
RoundedCornersTransformation(cornerRadius.toFloat()))
} else {
builder.size(getSafeRemoteViewsImageSize(context))
}