diff options
author | Scott Jackson <daneren2005@gmail.com> | 2012-12-01 16:54:24 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2012-12-01 16:54:24 -0800 |
commit | 89bdb9e10c74fb3f8ea7b581e44ed3ce96f00ad0 (patch) | |
tree | 2e32749cf01642e00f167a831eed15c5b33908aa /subsonic-android | |
parent | c87d2fe915e60b601c91f17f2dffb2f985cdf574 (diff) | |
download | dsub-89bdb9e10c74fb3f8ea7b581e44ed3ce96f00ad0.tar.gz dsub-89bdb9e10c74fb3f8ea7b581e44ed3ce96f00ad0.tar.bz2 dsub-89bdb9e10c74fb3f8ea7b581e44ed3ce96f00ad0.zip |
Changed to require 500 MB instead of 5% of disk be available
Diffstat (limited to 'subsonic-android')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/util/CacheCleaner.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/util/CacheCleaner.java b/subsonic-android/src/github/daneren2005/dsub/util/CacheCleaner.java index 7b96197c..732d6a57 100644 --- a/subsonic-android/src/github/daneren2005/dsub/util/CacheCleaner.java +++ b/subsonic-android/src/github/daneren2005/dsub/util/CacheCleaner.java @@ -24,7 +24,7 @@ import java.util.*; public class CacheCleaner { private static final String TAG = CacheCleaner.class.getSimpleName(); - private static final double MAX_FILE_SYSTEM_USAGE = 0.95; + private static final long MIN_FREE_SPACE = 500 * 1024L * 1024L; private final Context context; private final DownloadService downloadService; @@ -75,7 +75,7 @@ public class CacheCleaner { long bytesTotalFs = (long) stat.getBlockCount() * (long) stat.getBlockSize(); long bytesAvailableFs = (long) stat.getAvailableBlocks() * (long) stat.getBlockSize(); long bytesUsedFs = bytesTotalFs - bytesAvailableFs; - long minFsAvailability = Math.round(MAX_FILE_SYSTEM_USAGE * (double) bytesTotalFs); + long minFsAvailability = bytesTotalFs - MIN_FREE_SPACE; long bytesToDeleteCacheLimit = Math.max(bytesUsedBySubsonic - cacheSizeBytes, 0L); long bytesToDeleteFsLimit = Math.max(bytesUsedFs - minFsAvailability, 0L); |