Skip to content

Commit c1901b7

Browse files
committed
2 parents 9708919 + baf9458 commit c1901b7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

StabilityMatrix.Core/Updater/UpdateHelper.cs

+11-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ await response.Content.ReadAsStreamAsync().ConfigureAwait(false),
150150
foreach (
151151
var channel in Enum.GetValues(typeof(UpdateChannel))
152152
.Cast<UpdateChannel>()
153-
.Where(c => c > UpdateChannel.Unknown)
153+
.Where(
154+
c =>
155+
c > UpdateChannel.Unknown
156+
&& c <= settingsManager.Settings.PreferredUpdateChannel
157+
)
154158
)
155159
{
156160
if (
@@ -202,6 +206,12 @@ private bool ValidateUpdate(UpdateInfo? update)
202206
// Same version available, check if we both have commit hash metadata
203207
var updateHash = update.Version.Metadata;
204208
var appHash = Compat.AppVersion.Metadata;
209+
210+
// Trim both to the lower length, to a minimum of 7 characters
211+
var minLength = Math.Min(7, Math.Min(updateHash.Length, appHash.Length));
212+
updateHash = updateHash[..minLength];
213+
appHash = appHash[..minLength];
214+
205215
// If different, we can update
206216
if (updateHash != appHash)
207217
{

0 commit comments

Comments
 (0)