1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 18:34:46 +00:00

Fix disk space check size error

This commit is contained in:
Tw93
2025-11-22 13:32:32 +08:00
parent df66b69329
commit c3edf3c625
3 changed files with 7 additions and 1 deletions

View File

@@ -453,6 +453,10 @@ func collectDisks() ([]DiskStatus, error) {
if strings.HasPrefix(part.Mountpoint, "/System/Volumes/") {
continue
}
// Skip private volumes
if strings.HasPrefix(part.Mountpoint, "/private/") {
continue
}
if seenDevice[part.Device] {
continue
}
@@ -464,7 +468,9 @@ func collectDisks() ([]DiskStatus, error) {
if usage.Total < 1<<30 {
continue
}
volKey := fmt.Sprintf("%s:%d", part.Fstype, usage.Total>>30)
// For APFS volumes, use a more precise dedup key (bytes level)
// to handle shared storage pools properly
volKey := fmt.Sprintf("%s:%d", part.Fstype, usage.Total)
if seenVolume[volKey] {
continue
}