Browse Source

Trim build metadata in update version comparisons

pull/324/head
Ionite 1 year ago
parent
commit
ff34b4320b
No known key found for this signature in database
  1. 6
      StabilityMatrix.Core/Updater/UpdateHelper.cs

6
StabilityMatrix.Core/Updater/UpdateHelper.cs

@ -258,6 +258,12 @@ public class UpdateHelper : IUpdateHelper
// Same version available, check if we both have commit hash metadata
var updateHash = update.Version.Metadata;
var appHash = Compat.AppVersion.Metadata;
// Trim both to the lower length, to a minimum of 7 characters
var minLength = Math.Min(7, Math.Min(updateHash.Length, appHash.Length));
updateHash = updateHash[..minLength];
appHash = appHash[..minLength];
// If different, we can update
if (updateHash != appHash)
{

Loading…
Cancel
Save