music: index negative replaygain tags

Caused by an absurd error stemming from absurd helper function naming.
This commit is contained in:
Alexander Capehart 2023-07-04 15:09:47 -06:00
parent f8fbcac482
commit 87bb47cec3
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
4 changed files with 8 additions and 11 deletions

View file

@ -2,16 +2,10 @@
## dev
#### What's New
- Menus have been refreshed with a cleaner look
#### What's Fixed
- Fixed issue where one could not navigate to settings after navigating
elsewhere
- Fixed issue where one could not navigate to settings after navigating elsewhere
- Fixed the queue list being non-scrollable in certain cases
#### Dev/Meta
- Unified navigation graph
- Fixed negative ReplayGain adjustments not being applied
## 3.1.3

View file

@ -32,7 +32,7 @@ import org.oxycblt.auxio.music.info.Date
import org.oxycblt.auxio.music.metadata.correctWhitespace
import org.oxycblt.auxio.music.metadata.splitEscaped
@Database(entities = [CachedSong::class], version = 32, exportSchema = false)
@Database(entities = [CachedSong::class], version = 34, exportSchema = false)
abstract class CacheDatabase : RoomDatabase() {
abstract fun cachedSongsDao(): CachedSongsDao
}

View file

@ -314,7 +314,10 @@ private class TagWorkerImpl(
* @return A parsed adjustment float, or null if the adjustment had invalid formatting.
*/
private fun List<String>.parseReplayGainAdjustment() =
first().replace(REPLAYGAIN_ADJUSTMENT_FILTER_REGEX, "").toFloatOrNull()?.nonZeroOrNull()
first()
.replace(REPLAYGAIN_ADJUSTMENT_FILTER_REGEX, "")
.toFloatOrNull()
?.nonZeroOrNull()
private companion object {
val COMPILATION_ALBUM_ARTISTS = listOf("Various Artists")

View file

@ -55,7 +55,7 @@ fun Long.nonZeroOrNull() = if (this > 0) this else null
*
* @return The same number if it's non-zero, null otherwise.
*/
fun Float.nonZeroOrNull() = if (this > 0) this else null
fun Float.nonZeroOrNull() = if (this != 0f) this else null
/**
* Aliases a check to ensure a given value is in a specified range.