Skip to content

Commit f791153

Browse files
committed
Bugfix: SMB share showed 0 bytes free
Cause: `NSURLVolumeAvailableCapacityForImportantUsageKey` returns 0 (not nil) on network filesystems, preventing fallback to the plain capacity key.
1 parent 71de96e commit f791153

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • apps/desktop/src-tauri/src/volumes

apps/desktop/src-tauri/src/volumes/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ pub fn get_volume_space(path: &str) -> Option<VolumeSpaceInfo> {
474474

475475
let total = get_u64_resource(&url, "NSURLVolumeTotalCapacityKey")?;
476476
let available = get_u64_resource(&url, "NSURLVolumeAvailableCapacityForImportantUsageKey")
477+
.filter(|&v| v > 0)
477478
.or_else(|| get_u64_resource(&url, "NSURLVolumeAvailableCapacityKey"))?;
478479

479480
Some(VolumeSpaceInfo {

0 commit comments

Comments
 (0)