add free drive space display, file compactor hint, recalculate size after compacting

This commit is contained in:
rootdarkarchon
2024-02-14 18:57:18 +01:00
committed by Loporrit
parent 08eb1d194a
commit 50990542fd
3 changed files with 23 additions and 7 deletions

View File

@@ -61,6 +61,7 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase
public long CurrentFileProgress => _currentFileProgress;
public long FileCacheSize { get; set; }
public long FileCacheDriveFree { get; set; }
public ConcurrentDictionary<string, int> HaltScanLocks { get; set; } = new(StringComparer.Ordinal);
public bool IsScanRunning => CurrentFileProgress > 0 || TotalFiles > 0;
public long TotalFiles { get; private set; }
@@ -369,6 +370,9 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase
}
});
DriveInfo di = new DriveInfo(new DirectoryInfo(_configService.Current.CacheFolder).Root.FullName);
FileCacheDriveFree = di.AvailableFreeSpace;
var maxCacheInBytes = (long)(_configService.Current.MaxLocalCacheInGiB * 1024d * 1024d * 1024d);
if (FileCacheSize < maxCacheInBytes) return false;