Update DiskInfoToolkit. (#2046)

Remove usage sensor if any partition on disk is another operating system partition as this leads to incorrectly reported free space.
This commit is contained in:
Blacktempel
2025-11-14 14:16:45 +01:00
committed by GitHub
parent f402533ddf
commit c333504957
2 changed files with 7 additions and 3 deletions
@@ -140,7 +140,10 @@ public sealed class StorageDevice : Hardware, ISmart
r.AppendLine();
r.AppendLine($"Total Free Size: {_storage.TotalFreeSize}");
if (_storage.TotalFreeSize != null)
{
r.AppendLine($"Total Free Size: {_storage.TotalFreeSize}");
}
}
r.AppendLine($"Total Size: {_storage.TotalSize}");
@@ -311,7 +314,8 @@ public sealed class StorageDevice : Hardware, ISmart
private void ToggleUsageSensor()
{
if (!_storage.IsDynamicDisk)
if (!_storage.IsDynamicDisk
&& !_storage.Partitions.Any(p => p.IsOtherOperatingSystemPartition))
{
ActivateSensor(_usageSensor);
}
@@ -55,7 +55,7 @@
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DiskInfoToolkit" Version="1.0.3" />
<PackageReference Include="DiskInfoToolkit" Version="1.0.4" />
<PackageReference Include="HidSharp" Version="2.6.4" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.242">
<PrivateAssets>all</PrivateAssets>