musikr: refactor cache api

To make the pruning system more agnostic and "extendable"
This commit is contained in:
Alexander Capehart
2024-12-26 13:58:23 -05:00
parent 3f364dc5c6
commit 61fd11fe04
6 changed files with 108 additions and 76 deletions
@@ -362,7 +362,7 @@ constructor(
val currentRevision = musicSettings.revision
val newRevision = currentRevision?.takeIf { withCache } ?: UUID.randomUUID()
val cache = if (withCache) storedCache.full() else storedCache.writeOnly()
val cache = if (withCache) storedCache.visible() else storedCache.invisible()
val covers = MutableRevisionedStoredCovers(context, newRevision)
val storage = Storage(cache, covers, storedPlaylists)
val interpretation = Interpretation(nameFactory, separators)