diff --git a/Source/AppScaffolding/LibationScaffolding.cs b/Source/AppScaffolding/LibationScaffolding.cs index 31eaa833..84ec6fe4 100644 --- a/Source/AppScaffolding/LibationScaffolding.cs +++ b/Source/AppScaffolding/LibationScaffolding.cs @@ -29,6 +29,9 @@ namespace AppScaffolding public static class LibationScaffolding { + public const string RepositoryUrl = "ht" + "tps://github.com/rmcrackan/Libation"; + public const string WebsiteUrl = "ht" + "tps://getlibation.com"; + public const string RepositoryLatestUrl = "ht" + "tps://github.com/rmcrackan/Libation/releases/latest"; public static ReleaseIdentifier ReleaseIdentifier { get; private set; } public static VarietyType Variety => ReleaseIdentifier == ReleaseIdentifier.WindowsClassic ? VarietyType.Classic @@ -354,7 +357,7 @@ namespace AppScaffolding public static UpgradeProperties GetLatestRelease() { // timed out - (var latest, var zip) = getLatestRelease(TimeSpan.FromSeconds(10)); + (var latest, var zip) = getLatestRelease(TimeSpan.FromSeconds(10000)); if (latest is null || zip is null) return null; @@ -363,9 +366,6 @@ namespace AppScaffolding if (!Version.TryParse(latestVersionString, out var latestRelease)) return null; - // we're up to date - if (latestRelease <= BuildVersion) - return null; // we have an update @@ -378,7 +378,7 @@ namespace AppScaffolding zipUrl }); - return new(zipUrl, latest.HtmlUrl, zip.Name, latestRelease); + return new(zipUrl, latest.HtmlUrl, zip.Name, latestRelease, latest.Body); } private static (Octokit.Release, Octokit.ReleaseAsset) getLatestRelease(TimeSpan timeout) { diff --git a/Source/AppScaffolding/UpgradeProperties.cs b/Source/AppScaffolding/UpgradeProperties.cs index f1ca062f..d3a040f2 100644 --- a/Source/AppScaffolding/UpgradeProperties.cs +++ b/Source/AppScaffolding/UpgradeProperties.cs @@ -1,6 +1,34 @@ using System; +using System.Text.RegularExpressions; namespace AppScaffolding { - public record UpgradeProperties(string ZipUrl, string HtmlUrl, string ZipName, Version LatestRelease); + public record UpgradeProperties + { + private static readonly Regex linkstripper = new Regex(@"\[(.*)\]\(.*\)"); + public string ZipUrl { get; } + public string HtmlUrl { get; } + public string ZipName { get; } + public Version LatestRelease { get; } + public string Notes { get; } + + public UpgradeProperties(string zipUrl, string htmlUrl, string zipName, Version latestRelease, string notes) + { + ZipName = zipName; + HtmlUrl = htmlUrl; + ZipUrl = zipUrl; + LatestRelease = latestRelease; + Notes = stripMarkdownLinks(notes); + } + private string stripMarkdownLinks(string body) + { + body = body.Replace(@"\", ""); + var matches = linkstripper.Matches(body); + + foreach (Match match in matches) + body = body.Replace(match.Groups[0].Value, match.Groups[1].Value); + + return body; + } + } } diff --git a/Source/LibationAvalonia/Dialogs/UpgradeNotification.axaml b/Source/LibationAvalonia/Dialogs/UpgradeNotification.axaml deleted file mode 100644 index 7318396d..00000000 --- a/Source/LibationAvalonia/Dialogs/UpgradeNotification.axaml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - -