deps: upgrade
AndroidX core -> 1.8.0 Material Components -> 1.6.1
This commit is contained in:
@@ -28,8 +28,9 @@ import com.google.android.exoplayer2.source.TrackGroupArray
|
||||
import com.google.common.util.concurrent.FutureCallback
|
||||
import com.google.common.util.concurrent.Futures
|
||||
import java.util.concurrent.ConcurrentLinkedQueue
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.concurrent.Future
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.asExecutor
|
||||
import org.oxycblt.auxio.music.MusicStore
|
||||
import org.oxycblt.auxio.music.Song
|
||||
import org.oxycblt.auxio.util.logW
|
||||
@@ -92,7 +93,9 @@ class ExoPlayerBackend(private val inner: MediaStoreBackend) : Indexer.Backend {
|
||||
callback.onLoadStateChanged(
|
||||
MusicStore.LoadState.Indexing(songs.size, cursor.count))
|
||||
},
|
||||
CALLBACK_EXECUTOR)
|
||||
// Normal JVM dispatcher will suffice here, as there is no IO work
|
||||
// going on (and there is no cost from switching contexts with executors)
|
||||
Dispatchers.Default.asExecutor())
|
||||
|
||||
runningTasks[index] = task
|
||||
|
||||
@@ -114,7 +117,7 @@ class ExoPlayerBackend(private val inner: MediaStoreBackend) : Indexer.Backend {
|
||||
) : FutureCallback<TrackGroupArray> {
|
||||
override fun onSuccess(result: TrackGroupArray) {
|
||||
val metadata = result[0].getFormat(0).metadata
|
||||
|
||||
|
||||
if (metadata != null) {
|
||||
completeAudio(audio, metadata)
|
||||
} else {
|
||||
@@ -217,7 +220,5 @@ class ExoPlayerBackend(private val inner: MediaStoreBackend) : Indexer.Backend {
|
||||
companion object {
|
||||
/** The amount of tasks this backend can run efficiently at once. */
|
||||
private const val TASK_CAPACITY = 8
|
||||
|
||||
private val CALLBACK_EXECUTOR = Executors.newSingleThreadExecutor()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ object Indexer {
|
||||
else -> Api21MediaStoreBackend()
|
||||
}
|
||||
|
||||
val songs = buildSongs(context, mediaStoreBackend, callback)
|
||||
val songs = buildSongs(context, ExoPlayerBackend(mediaStoreBackend), callback)
|
||||
if (songs.isEmpty()) {
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -103,10 +103,9 @@ val String.id3v2GenreName: String
|
||||
// should copy mutagen's implementation?
|
||||
// https://github.com/quodlibet/mutagen/blob/master/mutagen/id3/_frames.py
|
||||
|
||||
val genreInt = substring(1 until lastIndex).toIntOrNull()
|
||||
if (genreInt != null) {
|
||||
return genreConstantTable.getOrNull(genreInt) ?: this
|
||||
}
|
||||
return substring(1 until lastIndex).toIntOrNull()?.run {
|
||||
genreConstantTable.getOrNull(this)
|
||||
} ?: this
|
||||
}
|
||||
|
||||
// Current name is fine.
|
||||
|
||||
Reference in New Issue
Block a user