all: cleanup
This commit is contained in:
@@ -181,7 +181,8 @@ private constructor(private val cursor: Cursor, volumeManager: VolumeManager) :
|
||||
val displayName = cursor.getString(displayNameIndex)
|
||||
val volume = volumes.find { it.mediaStoreName == volumeName }
|
||||
if (volume == null) {
|
||||
logE("Could not find volume for $volumeName:$relativePath/$displayName [tried: ${volumes.map { it.mediaStoreName }}]")
|
||||
logE(
|
||||
"Could not find volume for $volumeName:$relativePath/$displayName [tried: ${volumes.map { it.mediaStoreName }}]")
|
||||
return null
|
||||
}
|
||||
val components = Components.parseUnix(relativePath).child(displayName)
|
||||
|
||||
@@ -101,9 +101,9 @@ private class TagWorkerImpl(
|
||||
|
||||
// If this metadata is of a vorbis file, we actually need to extract it's base gain
|
||||
// and divide it by 256 to get the gain in decibels.
|
||||
if (format.sampleMimeType == MimeTypes.AUDIO_OPUS
|
||||
&& format.initializationData.isNotEmpty()
|
||||
&& format.initializationData[0].size >= 18) {
|
||||
if (format.sampleMimeType == MimeTypes.AUDIO_OPUS &&
|
||||
format.initializationData.isNotEmpty() &&
|
||||
format.initializationData[0].size >= 18) {
|
||||
val header = format.initializationData[0]
|
||||
val gain = header[1].toInt() or ((header[0].toInt() shl 8) and 0xFF)
|
||||
logD("Obtained opus base gain: ${gain / 256f} dB")
|
||||
@@ -112,7 +112,6 @@ private class TagWorkerImpl(
|
||||
rawSong.replayGainAlbumAdjustment =
|
||||
rawSong.replayGainAlbumAdjustment?.plus(gain / 256f)
|
||||
}
|
||||
|
||||
} else {
|
||||
logD("No metadata could be extracted for ${rawSong.name}")
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Auxio Project
|
||||
* SaneShuffleOrder.kt is part of Auxio.
|
||||
* BetterShuffleOrder.kt is part of Auxio.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
Reference in New Issue
Block a user