Multi-Platform Package Manager for Stable Diffusion
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

24 lines
749 B

using System.Text.Json.Serialization;
namespace StabilityMatrix.Core.Models;
public class InstalledPackageVersion
{
public string? InstalledReleaseVersion { get; set; }
public string? InstalledBranch { get; set; }
public string? InstalledCommitSha { get; set; }
public bool IsPrerelease { get; set; }
[JsonIgnore]
public bool IsReleaseMode => string.IsNullOrWhiteSpace(InstalledBranch);
[JsonIgnore]
public string DisplayVersion =>
(
IsReleaseMode
? InstalledReleaseVersion
: string.IsNullOrWhiteSpace(InstalledCommitSha)
? InstalledBranch
: $"{InstalledBranch}@{InstalledCommitSha[..7]}"
) ?? string.Empty;
}