Versioning Fix & Improvement (#553)
* Fix UpdaterService versioning (#544) * Add "Available" to newer, non-installed updates * Add if...else logic to Available/Installed badge * Change substring to account for bigger versions (#544) * Cache BuildInfo.version into local variable (#544) * Cache BuildInfo.Version.ToString() into local variable (#544) Co-authored-by: Yovarni Yearwood <yovarni@hawser.org>
This commit is contained in:
parent
1f0fa6e5b6
commit
31ae65b2b7
3 changed files with 16 additions and 8 deletions
|
@ -90,12 +90,17 @@ namespace API.Services.Tasks
|
|||
private UpdateNotificationDto CreateDto(GithubReleaseMetadata update)
|
||||
{
|
||||
if (update == null || string.IsNullOrEmpty(update.Tag_Name)) return null;
|
||||
var version = update.Tag_Name.Replace("v", string.Empty);
|
||||
var updateVersion = new Version(version);
|
||||
var updateVersion = new Version(update.Tag_Name.Replace("v", string.Empty));
|
||||
var currentVersion = BuildInfo.Version.ToString();
|
||||
|
||||
if (updateVersion.Revision == -1)
|
||||
{
|
||||
currentVersion = currentVersion.Substring(0, currentVersion.LastIndexOf("."));
|
||||
}
|
||||
|
||||
return new UpdateNotificationDto()
|
||||
{
|
||||
CurrentVersion = version,
|
||||
CurrentVersion = currentVersion,
|
||||
UpdateVersion = updateVersion.ToString(),
|
||||
UpdateBody = _markdown.Transform(update.Body.Trim()),
|
||||
UpdateTitle = update.Name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue