From 45996b730ee06148a39915b9dbb6cdb450ba0a31 Mon Sep 17 00:00:00 2001 From: Asval Date: Fri, 11 Oct 2024 18:31:05 +0200 Subject: [PATCH] my dumbass --- FModel/ViewModels/ApiEndpoints/FModelApiEndpoint.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/FModel/ViewModels/ApiEndpoints/FModelApiEndpoint.cs b/FModel/ViewModels/ApiEndpoints/FModelApiEndpoint.cs index 90684479..34fcca98 100644 --- a/FModel/ViewModels/ApiEndpoints/FModelApiEndpoint.cs +++ b/FModel/ViewModels/ApiEndpoints/FModelApiEndpoint.cs @@ -125,9 +125,9 @@ public class FModelApiEndpoint : AbstractApiProvider CurrentVersion = _infos.Version.SubstringBefore('-'), ChangelogURL = _infos.ChangelogUrl, DownloadURL = _infos.DownloadUrl, - Mandatory = new Mandatory + Mandatory = new CustomMandatory { - MinimumVersion = _infos.Version.SubstringAfter('+') + CommitHash = _infos.Version.SubstringAfter('+') } }; } @@ -139,7 +139,7 @@ public class FModelApiEndpoint : AbstractApiProvider { UserSettings.Default.LastUpdateCheck = DateTime.Now; - if (args.Mandatory.MinimumVersion == Constants.APP_COMMIT_ID) + if (((CustomMandatory)args.Mandatory).CommitHash == Constants.APP_COMMIT_ID) { if (UserSettings.Default.ShowChangelog) ShowChangelog(args); @@ -173,3 +173,9 @@ public class FModelApiEndpoint : AbstractApiProvider UserSettings.Default.ShowChangelog = false; } } + +public class CustomMandatory : Mandatory +{ + public string CommitHash { get; set; } + public string ShortCommitHash => CommitHash[..7]; +}