all: reformat

This commit is contained in:
Alexander Capehart 2024-02-24 13:28:49 -07:00
parent 5efdfb6aac
commit 3a04bef074
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -20,7 +20,6 @@ package org.oxycblt.auxio.music.metadata
import androidx.core.text.isDigitsOnly import androidx.core.text.isDigitsOnly
import androidx.media3.common.MediaItem import androidx.media3.common.MediaItem
import androidx.media3.common.MimeTypes
import androidx.media3.exoplayer.MetadataRetriever import androidx.media3.exoplayer.MetadataRetriever
import androidx.media3.exoplayer.source.MediaSource import androidx.media3.exoplayer.source.MediaSource
import androidx.media3.exoplayer.source.TrackGroupArray import androidx.media3.exoplayer.source.TrackGroupArray
@ -99,10 +98,9 @@ private class TagWorkerImpl(
populateWithId3v2(textTags.id3v2) populateWithId3v2(textTags.id3v2)
populateWithVorbis(textTags.vorbis) populateWithVorbis(textTags.vorbis)
// OPUS base gain interpretation code: This is likely not needed, as the media player // OPUS base gain interpretation code: This is likely not needed, as the media player
// should be using the base gain already. Uncomment if that's not the case. // should be using the base gain already. Uncomment if that's not the case.
//if (format.sampleMimeType == MimeTypes.AUDIO_OPUS // if (format.sampleMimeType == MimeTypes.AUDIO_OPUS
// && format.initializationData.isNotEmpty() // && format.initializationData.isNotEmpty()
// && format.initializationData[0].size >= 18) { // && format.initializationData[0].size >= 18) {
// val header = format.initializationData[0] // val header = format.initializationData[0]
@ -119,7 +117,7 @@ private class TagWorkerImpl(
// } else { // } else {
// logD("Ignoring opus base gain") // logD("Ignoring opus base gain")
// } // }
//} // }
} else { } else {
logD("No metadata could be extracted for ${rawSong.name}") logD("No metadata could be extracted for ${rawSong.name}")
} }
@ -331,7 +329,11 @@ private class TagWorkerImpl(
} }
private fun List<String>.parseR128Adjustment() = private fun List<String>.parseR128Adjustment() =
first().replace(REPLAYGAIN_ADJUSTMENT_FILTER_REGEX, "").toFloatOrNull()?.nonZeroOrNull()?.run { first()
.replace(REPLAYGAIN_ADJUSTMENT_FILTER_REGEX, "")
.toFloatOrNull()
?.nonZeroOrNull()
?.run {
// Convert to fixed-point and adjust to LUFS 18 to match the ReplayGain scale // Convert to fixed-point and adjust to LUFS 18 to match the ReplayGain scale
this / 256f + 5 this / 256f + 5
} }