Skip to content

Commit

Permalink
Added RecommendedCompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Apr 30, 2024
1 parent b12272e commit 2bbb0db
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public sealed record CompatibilityScoreResultModuleEntry
public required ModuleId ModuleId { get; init; }
public required double Compatibility { get; init; }

public required double? RecommendedCompatibility { get; init; }
public required ModuleVersion? RecommendedModuleVersion { get; init; }
}
public sealed record CompatibilityScoreResult
Expand Down Expand Up @@ -168,6 +169,7 @@ private async IAsyncEnumerable<CompatibilityScoreResultModuleEntry> GetCompatibi
{
ModuleId = module.ModuleId,
Compatibility = Math.Round(currentVersionScore * 100, 2, MidpointRounding.ToNegativeInfinity),
RecommendedCompatibility = null,
RecommendedModuleVersion = null,
};
}
Expand All @@ -177,7 +179,8 @@ private async IAsyncEnumerable<CompatibilityScoreResultModuleEntry> GetCompatibi
yield return new CompatibilityScoreResultModuleEntry
{
ModuleId = module.ModuleId,
Compatibility = Math.Round(recommendedVersionScore * 100, 2),
Compatibility = Math.Round(currentVersionScore * 100, 2, MidpointRounding.ToNegativeInfinity),
RecommendedCompatibility = Math.Round(recommendedVersionScore * 100, 2, MidpointRounding.ToNegativeInfinity),
RecommendedModuleVersion = recommendedVersion,
};
}
Expand Down

0 comments on commit 2bbb0db

Please sign in to comment.