更新UI
This commit is contained in:
@@ -140,6 +140,7 @@ public sealed class AppInstallerUpdateService(
|
||||
return null;
|
||||
}
|
||||
|
||||
var noticeDocument = UpdateNoticeDocumentBuilder.FromJson(root, latest);
|
||||
var build = FirstNonEmpty(GetString(latest, "build"), GetString(latest, "build_number"), GetString(root, "build"));
|
||||
var download = FirstNonEmpty(
|
||||
GetString(installer, "url"),
|
||||
@@ -209,7 +210,8 @@ public sealed class AppInstallerUpdateService(
|
||||
GetString(package, "updateTime"),
|
||||
GetString(package, "updateDate"))),
|
||||
messageMarkdown,
|
||||
releaseNotesMarkdown);
|
||||
releaseNotesMarkdown,
|
||||
noticeDocument);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -27,7 +27,8 @@ public sealed record RemoteUpdateInfo(
|
||||
long SizeBytes,
|
||||
DateTimeOffset? PublishedAt,
|
||||
string MessageMarkdown = "",
|
||||
string ReleaseNotesMarkdown = "")
|
||||
string ReleaseNotesMarkdown = "",
|
||||
UpdateNoticeDocument? NoticeDocument = null)
|
||||
{
|
||||
public string EffectiveVersion => UpdateVersionComparer.NormalizeVersion(Version, Build);
|
||||
public string NormalizedVersion => EffectiveVersion;
|
||||
@@ -35,6 +36,16 @@ public sealed record RemoteUpdateInfo(
|
||||
public bool HasMarkdownNotes => !string.IsNullOrWhiteSpace(MessageMarkdown) || !string.IsNullOrWhiteSpace(ReleaseNotesMarkdown);
|
||||
public string DisplayMessage => string.IsNullOrWhiteSpace(MessageMarkdown) ? Message : MessageMarkdown;
|
||||
public string DisplayReleaseNotes => string.IsNullOrWhiteSpace(ReleaseNotesMarkdown) ? ReleaseNotes : ReleaseNotesMarkdown;
|
||||
public UpdateNoticeDocument Notice => NoticeDocument ?? UpdateNoticeDocumentBuilder.FromText(
|
||||
Version,
|
||||
Build,
|
||||
Channel,
|
||||
Title,
|
||||
DisplayMessage,
|
||||
ReleaseNotes,
|
||||
ReleaseNotesMarkdown,
|
||||
PublishedAt,
|
||||
Mandatory);
|
||||
|
||||
public int CompareToCurrent(string currentVersion) => UpdateVersionComparer.Compare(Version, Build, currentVersion);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user