Actually disable caching if cache size is set to zero.
This commit is contained in:
parent
441ca3249c
commit
212b44a22f
|
@ -36,9 +36,11 @@ class Otter : Application() {
|
||||||
|
|
||||||
val exoCache: SimpleCache by lazy {
|
val exoCache: SimpleCache by lazy {
|
||||||
PowerPreference.getDefaultFile().getInt("media_cache_size", 1).toLong().let {
|
PowerPreference.getDefaultFile().getInt("media_cache_size", 1).toLong().let {
|
||||||
|
val cacheSize = if (it == 0L) 0 else it * 1024 * 1024 * 1024
|
||||||
|
|
||||||
SimpleCache(
|
SimpleCache(
|
||||||
cacheDir.resolve("media"),
|
cacheDir.resolve("media"),
|
||||||
LeastRecentlyUsedCacheEvictor(it * 1024 * 1024 * 1024),
|
LeastRecentlyUsedCacheEvictor(cacheSize),
|
||||||
exoDatabase
|
exoDatabase
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue