musikr: fix build issues
This commit is contained in:
@@ -32,8 +32,7 @@ import org.oxycblt.auxio.BuildConfig
|
||||
import org.oxycblt.auxio.image.covers.SettingCovers
|
||||
import org.oxycblt.musikr.cover.CoverResult
|
||||
|
||||
@AndroidEntryPoint
|
||||
class CoverProvider @Inject constructor(private val settingCovers: SettingCovers) :
|
||||
class CoverProvider() :
|
||||
ContentProvider() {
|
||||
override fun onCreate(): Boolean = true
|
||||
|
||||
@@ -43,7 +42,7 @@ class CoverProvider @Inject constructor(private val settingCovers: SettingCovers
|
||||
}
|
||||
val id = uri.lastPathSegment ?: return null
|
||||
return runBlocking {
|
||||
when (val result = settingCovers.immutable(requireNotNull(context)).obtain(id)) {
|
||||
when (val result = SettingCovers.immutable(requireNotNull(context)).obtain(id)) {
|
||||
is CoverResult.Hit -> result.cover.fd()
|
||||
else -> null
|
||||
}
|
||||
|
||||
@@ -31,18 +31,18 @@ import org.oxycblt.musikr.cover.FileCover
|
||||
import org.oxycblt.musikr.cover.MutableCovers
|
||||
|
||||
interface SettingCovers {
|
||||
suspend fun immutable(context: Context): Covers<out FileCover>
|
||||
|
||||
suspend fun mutate(context: Context, revision: UUID): MutableCovers<out Cover>
|
||||
|
||||
companion object {
|
||||
fun immutable(context: Context): Covers<out FileCover> =
|
||||
CompatCovers(context, BaseSiloedCovers(context))
|
||||
}
|
||||
}
|
||||
|
||||
class SettingCoversImpl
|
||||
@Inject
|
||||
constructor(private val imageSettings: ImageSettings, private val identifier: CoverIdentifier) :
|
||||
SettingCovers {
|
||||
override suspend fun immutable(context: Context): Covers<out FileCover> =
|
||||
CompatCovers(context, BaseSiloedCovers(context))
|
||||
|
||||
override suspend fun mutate(context: Context, revision: UUID): MutableCovers<out Cover> =
|
||||
when (imageSettings.coverMode) {
|
||||
CoverMode.OFF -> NullCovers(context)
|
||||
@@ -54,4 +54,5 @@ constructor(private val imageSettings: ImageSettings, private val identifier: Co
|
||||
private suspend fun siloedCovers(context: Context, revision: UUID, with: CoverParams) =
|
||||
MutableCompatCovers(
|
||||
context, MutableSiloedCovers.from(context, CoverSilo(revision, with), identifier))
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user