diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-04-11 19:55:01 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-04-11 19:55:01 -0400 |
commit | 2d47e479a5e48a575db3ca9998653c0435419440 (patch) | |
tree | 319498e8724137a5680186645ca8324f2949eba3 /src/SMAPI.Web/Framework/Clients/GitHub | |
parent | 15a80ab2442c18a478dbaec9d5120ec0cf25770b (diff) | |
download | SMAPI-2d47e479a5e48a575db3ca9998653c0435419440.tar.gz SMAPI-2d47e479a5e48a575db3ca9998653c0435419440.tar.bz2 SMAPI-2d47e479a5e48a575db3ca9998653c0435419440.zip |
fix draft releases being detected as update candidates
Diffstat (limited to 'src/SMAPI.Web/Framework/Clients/GitHub')
-rw-r--r-- | src/SMAPI.Web/Framework/Clients/GitHub/GitHubClient.cs | 2 | ||||
-rw-r--r-- | src/SMAPI.Web/Framework/Clients/GitHub/GitRelease.cs | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/SMAPI.Web/Framework/Clients/GitHub/GitHubClient.cs b/src/SMAPI.Web/Framework/Clients/GitHub/GitHubClient.cs index 4abe0737..2cfc6903 100644 --- a/src/SMAPI.Web/Framework/Clients/GitHub/GitHubClient.cs +++ b/src/SMAPI.Web/Framework/Clients/GitHub/GitHubClient.cs @@ -59,7 +59,7 @@ namespace StardewModdingAPI.Web.Framework.Clients.GitHub GitRelease[] results = await this.Client .GetAsync(string.Format(this.AnyReleaseUrlFormat, repo)) .AsArray<GitRelease>(); - return results.FirstOrDefault(); + return results.FirstOrDefault(p => !p.IsDraft); } return await this.Client diff --git a/src/SMAPI.Web/Framework/Clients/GitHub/GitRelease.cs b/src/SMAPI.Web/Framework/Clients/GitHub/GitRelease.cs index 827374fb..d0db5297 100644 --- a/src/SMAPI.Web/Framework/Clients/GitHub/GitRelease.cs +++ b/src/SMAPI.Web/Framework/Clients/GitHub/GitRelease.cs @@ -19,6 +19,10 @@ namespace StardewModdingAPI.Web.Framework.Clients.GitHub /// <summary>The Markdown description for the release.</summary> public string Body { get; set; } + /// <summary>Whether this is a draft version.</summary> + [JsonProperty("draft")] + public bool IsDraft { get; set; } + /// <summary>Whether this is a prerelease version.</summary> [JsonProperty("prerelease")] public bool IsPrerelease { get; set; } |