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 * Copyright (c) 2023 Auxio Project
* CoverSilo.kt is part of Auxio. * CoversModule.kt is part of Auxio.
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -18,11 +18,13 @@
package org.oxycblt.auxio.image.covers 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? = @Module
try { @InstallIn(SingletonComponent::class)
UUID.fromString(this) interface CoilModule {
} catch (e: IllegalArgumentException) { @Binds fun settingCovers(imageSettings: SettingCoversImpl): SettingCovers
null
} }

View file

@ -47,9 +47,7 @@ interface SettingCovers {
} }
} }
class SettingCoversImpl class SettingCoversImpl @Inject constructor(private val imageSettings: ImageSettings) :
@Inject
constructor(private val imageSettings: ImageSettings, private val identifier: CoverIdentifier) :
SettingCovers { SettingCovers {
override suspend fun mutate(context: Context, revision: UUID): MutableCovers<out Cover> { override suspend fun mutate(context: Context, revision: UUID): MutableCovers<out Cover> {
val coverStorage = CoverStorage.at(context.coversDir()) 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 revisionedTranscoding = RevisionedTranscoding(revision, transcoding)
val storedCovers = val storedCovers =
MutableStoredCovers(EmbeddedCovers(identifier), coverStorage, revisionedTranscoding) MutableStoredCovers(
EmbeddedCovers(CoverIdentifier.md5()), coverStorage, revisionedTranscoding)
val fsCovers = MutableFSCovers(context) val fsCovers = MutableFSCovers(context)
return MutableCovers.chain(storedCovers, fsCovers) return MutableCovers.chain(storedCovers, fsCovers)
} }