caching for non-ram music

This commit is contained in:
minjaesong
2024-04-03 00:28:11 +09:00
parent 9a8c91562e
commit 4094457ab9

View File

@@ -8,9 +8,7 @@ class MusicCache(val trackName: String) : Disposable {
private val cache = HashMap<String, MusicContainer>() private val cache = HashMap<String, MusicContainer>()
fun getOrPut(music: MusicContainer?): MusicContainer? { fun getOrPut(music: MusicContainer?): MusicContainer? {
if (music != null && !music.toRAM) if (music != null)
return music
if (music != null && music.toRAM) // for now only the on-the-RAM tracks are getting cached
return cache.getOrPut(music.name) { music.makeCopy() } return cache.getOrPut(music.name) { music.makeCopy() }
return null return null
} }