Browse Source

Actually disable caching if cache size is set to zero.

housekeeping/remove-warnings
Antoine POPINEAU 4 years ago
parent
commit
212b44a22f
No known key found for this signature in database
GPG Key ID: A78AC64694F84063
  1. 4
      app/src/main/java/com/github/apognu/otter/Otter.kt

4
app/src/main/java/com/github/apognu/otter/Otter.kt

@ -36,9 +36,11 @@ class Otter : Application() { @@ -36,9 +36,11 @@ class Otter : Application() {
val exoCache: SimpleCache by lazy {
PowerPreference.getDefaultFile().getInt("media_cache_size", 1).toLong().let {
val cacheSize = if (it == 0L) 0 else it * 1024 * 1024 * 1024
SimpleCache(
cacheDir.resolve("media"),
LeastRecentlyUsedCacheEvictor(it * 1024 * 1024 * 1024),
LeastRecentlyUsedCacheEvictor(cacheSize),
exoDatabase
)
}

Loading…
Cancel
Save