added downscaled as file scanning if exist. made gib to gb for calculations. changed windows detection.

This commit is contained in:
cake
2025-11-29 04:51:53 +01:00
parent d995afcf48
commit aa04ab05ab
4 changed files with 76 additions and 19 deletions

View File

@@ -32,7 +32,7 @@ namespace LightlessSync.Utils
{
string rootPath;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && (!IsProbablyWine() || !isWine))
if (OperatingSystem.IsWindows() && (!IsProbablyWine() || !isWine))
{
var info = new FileInfo(filePath);
var dir = info.Directory ?? new DirectoryInfo(filePath);
@@ -50,7 +50,7 @@ namespace LightlessSync.Utils
FilesystemType detected;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && (!IsProbablyWine() || !isWine))
if (OperatingSystem.IsWindows() && (!IsProbablyWine() || !isWine))
{
var root = new DriveInfo(rootPath);
var format = root.DriveFormat?.ToUpperInvariant() ?? string.Empty;
@@ -214,7 +214,7 @@ namespace LightlessSync.Utils
if (_blockSizeCache.TryGetValue(root, out int cached))
return cached;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !isWine)
if (OperatingSystem.IsWindows() && !isWine)
{
int result = GetDiskFreeSpaceW(root,
out uint sectorsPerCluster,