Fix storage usage calculation

This commit is contained in:
Koitharu
2023-08-30 14:21:00 +03:00
parent eeba161235
commit 399ac07fb3
2 changed files with 4 additions and 4 deletions

View File

@@ -53,11 +53,11 @@ class LocalStorageManager @Inject constructor(
}
suspend fun computeStorageSize() = withContext(Dispatchers.IO) {
getAvailableStorageDirs().sumOf { it.computeSize() }
getConfiguredStorageDirs().sumOf { it.computeSize() }
}
suspend fun computeAvailableSize() = runInterruptible(Dispatchers.IO) {
getAvailableStorageDirs().mapToSet { it.freeSpace }.sum()
getConfiguredStorageDirs().mapToSet { it.freeSpace }.sum()
}
suspend fun clearCache(cache: CacheDir) = runInterruptible(Dispatchers.IO) {