Don't consider version suffixes when checking for updates

This is just to make life easier for me with deploys for now.
This commit is contained in:
Dean Herbert 2021-07-20 01:05:36 +09:00
parent e77597c2b6
commit 9ea1f5900a
1 changed files with 8 additions and 2 deletions

View File

@ -3,6 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Newtonsoft.Json; using Newtonsoft.Json;
using osu.Framework; using osu.Framework;
@ -41,11 +42,16 @@ protected override async Task<bool> PerformUpdateCheck()
var latest = releases.ResponseObject; var latest = releases.ResponseObject;
if (latest.TagName != version) // avoid any discrepancies due to build suffixes for now.
// eventually we will want to support release streams and consider these.
version = version.Split('-').First();
var latestTagName = latest.TagName.Split('-').First();
if (latestTagName != version)
{ {
Notifications.Post(new SimpleNotification Notifications.Post(new SimpleNotification
{ {
Text = $"A newer release of osu! has been found ({version} → {latest.TagName}).\n\n" Text = $"A newer release of osu! has been found ({version} → {latestTagName}).\n\n"
+ "Click here to download the new version, which can be installed over the top of your existing installation", + "Click here to download the new version, which can be installed over the top of your existing installation",
Icon = FontAwesome.Solid.Upload, Icon = FontAwesome.Solid.Upload,
Activated = () => Activated = () =>