The GitHub account is gone, and with it the update feed and every link the app opened. Velopack now reads https://releases.poli0981.dev/commandforge (an HTTP source, ProductLinks.UpdateFeed); 404 / 403 / 429 / 5xx / offline are still told apart, and their messages name "the update server" instead of GitHub (Cloudflare's edge answers 403 when it refuses and 429 when it limits). ProductLinks: the source, user guide, accessibility statement and the four legal texts on Gitea (the Legal pages read them from ProductLinks instead of four hard-coded GitHub URLs); issues on the GitLab mirror, since Gitea's registration is closed. Report a bug opens a new GitLab issue with the title and the answered Bug template (.gitlab/issue_templates/Bug.md) as its description; a test keeps the app's sections and checklist equal to the template's. Strings in all five languages: "Source code" (was "GitHub"), "Read the full text online", "Open issue on GitLab", and the privacy and auto-check texts name releases.poli0981.dev. Keys Settings_GitHub and LegalGateReadOnGitHub become Settings_SourceCode and LegalGateReadFullText. A new test fails if any source file links to github.com/poli0981 again. The terms version stays 1.1: the update check sends the same request, only to another host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
1.3 KiB
C#
34 lines
1.3 KiB
C#
using CommandForge.Application.Ports;
|
|
|
|
namespace CommandForge.Application.UseCases;
|
|
|
|
/// <summary>
|
|
/// Coordinates update checks/downloads on top of <see cref="IUpdateService"/> (architectures.md §5).
|
|
/// Keeps the view-model thin and gives a Velopack-free seam for testing.
|
|
/// </summary>
|
|
public sealed class CheckForUpdateUseCase
|
|
{
|
|
private readonly IUpdateService _updates;
|
|
|
|
public CheckForUpdateUseCase(IUpdateService updates)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(updates);
|
|
_updates = updates;
|
|
}
|
|
|
|
/// <summary>Whether updates apply to this install (false in dev/unpackaged).</summary>
|
|
public bool IsSupported => _updates.IsUpdateSupported;
|
|
|
|
/// <summary>Checks the release feed for a newer version.</summary>
|
|
public Task<UpdateCheckResult> ExecuteAsync(CancellationToken cancellationToken = default)
|
|
=> _updates.CheckForUpdatesAsync(cancellationToken);
|
|
|
|
/// <summary>Downloads the pending update.</summary>
|
|
public Task<UpdateError> DownloadAsync(IProgress<int>? progress, CancellationToken cancellationToken = default)
|
|
=> _updates.DownloadAsync(progress, cancellationToken);
|
|
|
|
/// <summary>Applies the downloaded update and restarts.</summary>
|
|
public Task<UpdateError> ApplyAndRestartAsync(CancellationToken cancellationToken = default)
|
|
=> _updates.ApplyAndRestartAsync(cancellationToken);
|
|
}
|