music: move cover parsing to indexing
This drastically slows music loading, but my hope is that in practice most of the slowdown is actually in ExoPlayer's metadata extractor and if I switch off of that things will actually improve. Maybe.
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
|
||||
package org.oxycblt.auxio.music
|
||||
|
||||
import android.content.Context
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import javax.inject.Inject
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -209,6 +211,7 @@ class MusicRepositoryImpl
|
||||
@Inject
|
||||
constructor(
|
||||
private val musikr: Musikr,
|
||||
@ApplicationContext private val context: Context,
|
||||
private val tagDatabase: TagDatabase,
|
||||
private val musicSettings: MusicSettings
|
||||
) : MusicRepository {
|
||||
@@ -358,9 +361,10 @@ constructor(
|
||||
|
||||
val storage =
|
||||
if (withCache) {
|
||||
Storage(TagCache.full(tagDatabase), StoredCovers.buildOn())
|
||||
Storage(TagCache.full(tagDatabase), StoredCovers.from(context, "covers"))
|
||||
} else {
|
||||
Storage(TagCache.writeOnly(tagDatabase), StoredCovers.new())
|
||||
// TODO: Revisioned covers
|
||||
Storage(TagCache.writeOnly(tagDatabase), StoredCovers.from(context, "covers"))
|
||||
}
|
||||
val newLibrary =
|
||||
musikr.run(
|
||||
|
||||
Reference in New Issue
Block a user