Skip to content

Commit f39c95a

Browse files
committed
musikr: commit fs cache to files
1 parent 920dda0 commit f39c95a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

musikr/src/main/java/org/oxycblt/musikr/fs/device/DeviceFSCache.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ internal class DeviceFSCache(private val context: Context) {
178178
suspend fun saveCache() =
179179
withContext(Dispatchers.IO) {
180180
try {
181-
val cacheFile = File(context.cacheDir, CACHE_FILE_NAME)
181+
val cacheFile = File(context.filesDir, CACHE_FILE_NAME)
182182
val cacheData = CacheData(schemaVersion = SCHEMA_VERSION, entries = cache)
183183
cacheFile.writeText(Json.encodeToString(CacheData.serializer(), cacheData))
184184
} catch (e: Exception) {
@@ -190,7 +190,7 @@ internal class DeviceFSCache(private val context: Context) {
190190
suspend fun loadCache() =
191191
withContext(Dispatchers.IO) {
192192
try {
193-
val cacheFile = File(context.cacheDir, CACHE_FILE_NAME)
193+
val cacheFile = File(context.filesDir, CACHE_FILE_NAME)
194194
if (cacheFile.exists()) {
195195
val cacheDataString = cacheFile.readText()
196196
val cacheData = Json.decodeFromString<CacheData>(cacheDataString)

0 commit comments

Comments
 (0)