music: index negative replaygain tags
Caused by an absurd error stemming from absurd helper function naming.
This commit is contained in:
parent
ada446767d
commit
7adf7f7beb
4 changed files with 8 additions and 3 deletions
|
@ -10,6 +10,7 @@
|
|||
- Fixed the queue list being non-scrollable in certain cases
|
||||
- Fixed notification album covers not updating after changing the cover
|
||||
aspect ratio setting
|
||||
- Fixed negative ReplayGain adjustments not being applied
|
||||
|
||||
#### Dev/Meta
|
||||
- Unified navigation graph
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -314,7 +314,11 @@ 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()
|
||||
.also { logD(it) }
|
||||
|
||||
private companion object {
|
||||
val COMPILATION_ALBUM_ARTISTS = listOf("Various Artists")
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue