all: cleanup
This commit is contained in:
parent
b6703a178e
commit
5d5356e46e
4 changed files with 7 additions and 7 deletions
|
@ -181,7 +181,8 @@ private constructor(private val cursor: Cursor, volumeManager: VolumeManager) :
|
||||||
val displayName = cursor.getString(displayNameIndex)
|
val displayName = cursor.getString(displayNameIndex)
|
||||||
val volume = volumes.find { it.mediaStoreName == volumeName }
|
val volume = volumes.find { it.mediaStoreName == volumeName }
|
||||||
if (volume == null) {
|
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
|
return null
|
||||||
}
|
}
|
||||||
val components = Components.parseUnix(relativePath).child(displayName)
|
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
|
// 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.
|
// and divide it by 256 to get the gain in decibels.
|
||||||
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]
|
||||||
val gain = header[1].toInt() or ((header[0].toInt() shl 8) and 0xFF)
|
val gain = header[1].toInt() or ((header[0].toInt() shl 8) and 0xFF)
|
||||||
logD("Obtained opus base gain: ${gain / 256f} dB")
|
logD("Obtained opus base gain: ${gain / 256f} dB")
|
||||||
|
@ -112,7 +112,6 @@ private class TagWorkerImpl(
|
||||||
rawSong.replayGainAlbumAdjustment =
|
rawSong.replayGainAlbumAdjustment =
|
||||||
rawSong.replayGainAlbumAdjustment?.plus(gain / 256f)
|
rawSong.replayGainAlbumAdjustment?.plus(gain / 256f)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
logD("No metadata could be extracted for ${rawSong.name}")
|
logD("No metadata could be extracted for ${rawSong.name}")
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2017 Auxio Project
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -172,7 +172,7 @@
|
||||||
style="@style/Widget.Auxio.TextView.Header"
|
style="@style/Widget.Auxio.TextView.Header"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/lbl_author_name"
|
android:text="@string/lbl_author"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue