musikr: fix build issue
This commit is contained in:
parent
219d26b4dc
commit
f125e37e95
2 changed files with 14 additions and 13 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Auxio Project
|
||||
* CoverSilo.kt is part of Auxio.
|
||||
* Copyright (c) 2023 Auxio Project
|
||||
* CoversModule.kt is part of Auxio.
|
||||
*
|
||||
* 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
|
||||
|
@ -18,11 +18,13 @@
|
|||
|
||||
package org.oxycblt.auxio.image.covers
|
||||
|
||||
import java.util.UUID
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
|
||||
private fun String.toUuidOrNull(): UUID? =
|
||||
try {
|
||||
UUID.fromString(this)
|
||||
} catch (e: IllegalArgumentException) {
|
||||
null
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
interface CoilModule {
|
||||
@Binds fun settingCovers(imageSettings: SettingCoversImpl): SettingCovers
|
||||
}
|
|
@ -47,9 +47,7 @@ interface SettingCovers {
|
|||
}
|
||||
}
|
||||
|
||||
class SettingCoversImpl
|
||||
@Inject
|
||||
constructor(private val imageSettings: ImageSettings, private val identifier: CoverIdentifier) :
|
||||
class SettingCoversImpl @Inject constructor(private val imageSettings: ImageSettings) :
|
||||
SettingCovers {
|
||||
override suspend fun mutate(context: Context, revision: UUID): MutableCovers<out Cover> {
|
||||
val coverStorage = CoverStorage.at(context.coversDir())
|
||||
|
@ -63,7 +61,8 @@ constructor(private val imageSettings: ImageSettings, private val identifier: Co
|
|||
}
|
||||
val revisionedTranscoding = RevisionedTranscoding(revision, transcoding)
|
||||
val storedCovers =
|
||||
MutableStoredCovers(EmbeddedCovers(identifier), coverStorage, revisionedTranscoding)
|
||||
MutableStoredCovers(
|
||||
EmbeddedCovers(CoverIdentifier.md5()), coverStorage, revisionedTranscoding)
|
||||
val fsCovers = MutableFSCovers(context)
|
||||
return MutableCovers.chain(storedCovers, fsCovers)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue