This commit is contained in:
QWQLwToo
2026-07-12 09:12:12 +08:00
committed by admin_gitea
parent d44200fde1
commit 5e4355700f
43 changed files with 2797 additions and 709 deletions
@@ -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);