diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-12-08 08:19:13 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-08 08:19:13 -0600 |
| commit | ec60cfbd397badca9a76d3923c653ad7cb6561c5 (patch) | |
| tree | 7da287e6ece3104bdf0dcd17757c584a3ad6c46a /src/slskd/Application.cs | |
| parent | 39e26f9a940400102bb0b86e259d836362a95cea (diff) | |
| parent | 75b8075f480be97209435ad454d9c23d03d0b6c9 (diff) | |
| download | slskd-ec60cfbd397badca9a76d3923c653ad7cb6561c5.tar.gz | |
Merge pull request #297 from slskd/controls
Add controls for restarting and shutting down, add button for version check
Diffstat (limited to 'src/slskd/Application.cs')
| -rw-r--r-- | src/slskd/Application.cs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index d0cbe361..021a6c40 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -141,10 +141,17 @@ namespace slskd /// <returns>The operation context.</returns> public async Task CheckVersionAsync() { - if (Program.InformationalVersion.EndsWith("65534")) + if (Program.IsDevelopment) + { + Logger.Information("Skipping version check for Development build"); + return; + } + + if (Program.IsCanary) { // todo: use the docker hub API to find the latest canary tag Logger.Information("Skipping version check for Canary build; check for updates manually."); + return; } Logger.Information("Checking GitHub Releases for latest version"); @@ -154,17 +161,17 @@ namespace slskd var latestVersion = await GitHub.GetLatestReleaseVersion( organization: Program.AppName, repository: Program.AppName, - userAgent: $"{Program.AppName} v{Program.InformationalVersion}"); + userAgent: $"{Program.AppName} v{Program.FullVersion}"); - if (latestVersion > Version.Parse(Program.InformationalVersion)) + if (latestVersion > Version.Parse(Program.SemanticVersion)) { State.SetValue(state => state with { Version = state.Version with { Latest = latestVersion.ToString(), IsUpdateAvailable = true } }); - Logger.Information("A new version is available! {CurrentVersion} -> {LatestVersion}", Program.InformationalVersion, latestVersion); + Logger.Information("A new version is available! {CurrentVersion} -> {LatestVersion}", Program.SemanticVersion, latestVersion); } else { - State.SetValue(state => state with { Version = state.Version with { Latest = Program.InformationalVersion, IsUpdateAvailable = false } }); - Logger.Information("Version {CurrentVersion} is up to date.", Program.InformationalVersion); + State.SetValue(state => state with { Version = state.Version with { Latest = Program.SemanticVersion, IsUpdateAvailable = false } }); + Logger.Information("Version {CurrentVersion} is up to date.", Program.SemanticVersion); } } catch (Exception ex) |
