musikr: tweak api

This commit is contained in:
Alexander Capehart 2025-01-04 17:43:09 -07:00
parent 9166580703
commit 710e279d8f
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 8 additions and 8 deletions

View file

@ -30,6 +30,12 @@ interface MutableCovers : Covers {
suspend fun cleanup(excluding: Collection<Cover>) suspend fun cleanup(excluding: Collection<Cover>)
} }
sealed interface ObtainResult<T : Cover> {
data class Hit<T : Cover>(val cover: T) : ObtainResult<T>
class Miss<T : Cover> : ObtainResult<T>
}
interface Cover { interface Cover {
val id: String val id: String
@ -48,9 +54,3 @@ class CoverCollection private constructor(val covers: List<Cover>) {
.map { it.value.first() }) .map { it.value.first() })
} }
} }
sealed interface ObtainResult<T : Cover> {
data class Hit<T : Cover>(val cover: T) : ObtainResult<T>
class Miss<T : Cover> : ObtainResult<T>
}

View file

@ -20,7 +20,7 @@ package org.oxycblt.musikr.metadata
import org.oxycblt.musikr.util.correctWhitespace import org.oxycblt.musikr.util.correctWhitespace
class NativeTagMap { internal class NativeTagMap {
private val map = mutableMapOf<String, List<String>>() private val map = mutableMapOf<String, List<String>>()
fun addID(id: String, value: String) { fun addID(id: String, value: String) {