music: fix testing artifacts in loading process

Fix testing lines created when working on the prior commit.
This commit is contained in:
Alexander Capehart 2023-06-23 08:49:08 -06:00
parent 036d952085
commit 19e8536323
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -23,8 +23,6 @@ import android.content.pm.PackageManager
import androidx.core.content.ContextCompat
import java.util.LinkedList
import javax.inject.Inject
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.EmptyCoroutineContext
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
@ -372,8 +370,10 @@ constructor(
// Do the initial query of the cache and media databases in parallel.
logD("Starting MediaStore query")
val mediaStoreQueryJob = worker.scope.async {
val query = try {
val mediaStoreQueryJob =
worker.scope.async {
val query =
try {
mediaStoreExtractor.query()
} catch (e: Exception) {
return@async Result.failure(e)
@ -424,7 +424,8 @@ constructor(
logD("Starting DeviceLibrary creation")
val deviceLibraryJob =
worker.scope.async(Dispatchers.Default) {
val deviceLibrary = try {
val deviceLibrary =
try {
deviceLibraryFactory.create(completeSongs, processedSongs)
} catch (e: Exception) {
processedSongs.close(e)
@ -455,8 +456,10 @@ constructor(
logD("Discovered ${rawSongs.size} songs, starting finalization")
emitIndexingProgress(IndexingProgress.Indeterminate)
logD("Starting UserLibrary query")
val userLibraryQueryJob = worker.scope.async {
val rawPlaylists = try {
val userLibraryQueryJob =
worker.scope.async {
val rawPlaylists =
try {
userLibraryFactory.query()
} catch (e: Exception) {
return@async Result.failure(e)