playback: ignore zeroed replaygain tags

Ignore ReplayGain adjustments that are just 0 dB.
This commit is contained in:
Alexander Capehart 2023-06-13 08:57:03 -06:00
parent 4ee20bc112
commit 0771a75b5a
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 3 additions and 1 deletions

View file

@ -11,6 +11,7 @@
- Disc number is no longer mis-aligned when no subtitle is present - Disc number is no longer mis-aligned when no subtitle is present
- Fixed selection not updating when playlists are changed - Fixed selection not updating when playlists are changed
- Fixed duplicate albums appearing in certain cases - Fixed duplicate albums appearing in certain cases
- Fixed ReplayGain adjustment not applying at the start of a song in certain cases
## 3.1.1 ## 3.1.1

View file

@ -30,6 +30,7 @@ import org.oxycblt.auxio.music.fs.toAudioUri
import org.oxycblt.auxio.music.info.Date import org.oxycblt.auxio.music.info.Date
import org.oxycblt.auxio.util.logD import org.oxycblt.auxio.util.logD
import org.oxycblt.auxio.util.logW import org.oxycblt.auxio.util.logW
import org.oxycblt.auxio.util.nonZeroOrNull
/** /**
* An processing abstraction over the [MetadataRetriever] and [TextTags] workflow that operates on * An processing abstraction over the [MetadataRetriever] and [TextTags] workflow that operates on
@ -300,7 +301,7 @@ private class TagWorkerImpl(
* @return A parsed adjustment float, or null if the adjustment had invalid formatting. * @return A parsed adjustment float, or null if the adjustment had invalid formatting.
*/ */
private fun List<String>.parseReplayGainAdjustment() = private fun List<String>.parseReplayGainAdjustment() =
first().replace(REPLAYGAIN_ADJUSTMENT_FILTER_REGEX, "").toFloatOrNull() first().replace(REPLAYGAIN_ADJUSTMENT_FILTER_REGEX, "").toFloatOrNull()?.nonZeroOrNull()
private companion object { private companion object {
val COMPILATION_ALBUM_ARTISTS = listOf("Various Artists") val COMPILATION_ALBUM_ARTISTS = listOf("Various Artists")