musikr: fix build issue

This commit is contained in:
Alexander Capehart 2025-03-08 15:07:10 -07:00
parent 219d26b4dc
commit f125e37e95
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 14 additions and 13 deletions

View file

@ -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
}

View file

@ -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)
}