diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-01-11 16:53:58 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-01-11 16:53:58 -0500 |
commit | 609ceedaba6cd42e7025f1a15ebfeb26c69bab80 (patch) | |
tree | 2e781b48ba39d73d0dd60a1e2ae0f82c23c0279e | |
parent | 219696275df054d25cd385f950eb01ee33312e76 (diff) | |
download | SMAPI-609ceedaba6cd42e7025f1a15ebfeb26c69bab80.tar.gz SMAPI-609ceedaba6cd42e7025f1a15ebfeb26c69bab80.tar.bz2 SMAPI-609ceedaba6cd42e7025f1a15ebfeb26c69bab80.zip |
update for compatibility list change
-rw-r--r-- | src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs | 12 | ||||
-rw-r--r-- | src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs | 4 | ||||
-rw-r--r-- | src/SMAPI.Web/Framework/Caching/Wiki/CachedWikiMod.cs | 8 | ||||
-rw-r--r-- | src/SMAPI.Web/ViewModels/ModModel.cs | 7 | ||||
-rw-r--r-- | src/SMAPI.Web/Views/Mods/Index.cshtml | 7 |
5 files changed, 13 insertions, 25 deletions
diff --git a/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs b/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs index 384f23fc..c829c0f4 100644 --- a/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs +++ b/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs @@ -102,6 +102,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki string anchor = this.GetAttribute(node, "id"); string contentPackFor = this.GetAttribute(node, "data-content-pack-for"); string devNote = this.GetAttribute(node, "data-dev-note"); + string pullRequestUrl = this.GetAttribute(node, "data-pr"); IDictionary<string, string> mapLocalVersions = this.GetAttributeAsVersionMapping(node, "data-map-local-versions"); IDictionary<string, string> mapRemoteVersions = this.GetAttributeAsVersionMapping(node, "data-map-remote-versions"); @@ -132,15 +133,6 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki } } - // parse links - List<Tuple<Uri, string>> metadataLinks = new List<Tuple<Uri, string>>(); - foreach (HtmlNode linkElement in node.Descendants("td").Last().Descendants("a").Skip(1)) // skip anchor link - { - string text = linkElement.InnerText.Trim(); - Uri url = new Uri(linkElement.GetAttributeValue("href", "")); - metadataLinks.Add(Tuple.Create(url, text)); - } - // yield model yield return new WikiModEntry { @@ -159,7 +151,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki Compatibility = compatibility, BetaCompatibility = betaCompatibility, Warnings = warnings, - MetadataLinks = metadataLinks.ToArray(), + PullRequestUrl = pullRequestUrl, DevNote = devNote, MapLocalVersions = mapLocalVersions, MapRemoteVersions = mapRemoteVersions, diff --git a/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs b/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs index 931dcd43..474dce3d 100644 --- a/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs +++ b/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs @@ -57,8 +57,8 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki /// <summary>The human-readable warnings for players about this mod.</summary> public string[] Warnings { get; set; } - /// <summary>Extra metadata links (usually for open pull requests).</summary> - public Tuple<Uri, string>[] MetadataLinks { get; set; } + /// <summary>The URL of the pull request which submits changes for an unofficial update to the author, if any.</summary> + public string PullRequestUrl { get; set; } /// <summary>Special notes intended for developers who maintain unofficial updates or submit pull requests. </summary> public string DevNote { get; set; } diff --git a/src/SMAPI.Web/Framework/Caching/Wiki/CachedWikiMod.cs b/src/SMAPI.Web/Framework/Caching/Wiki/CachedWikiMod.cs index 8569984a..7e7c99bc 100644 --- a/src/SMAPI.Web/Framework/Caching/Wiki/CachedWikiMod.cs +++ b/src/SMAPI.Web/Framework/Caching/Wiki/CachedWikiMod.cs @@ -67,8 +67,8 @@ namespace StardewModdingAPI.Web.Framework.Caching.Wiki /// <summary>The human-readable warnings for players about this mod.</summary> public string[] Warnings { get; set; } - /// <summary>Extra metadata links (usually for open pull requests).</summary> - public Tuple<Uri, string>[] MetadataLinks { get; set; } + /// <summary>The URL of the pull request which submits changes for an unofficial update to the author, if any.</summary> + public string PullRequestUrl { get; set; } /// <summary>Special notes intended for developers who maintain unofficial updates or submit pull requests. </summary> public string DevNote { get; set; } @@ -150,7 +150,7 @@ namespace StardewModdingAPI.Web.Framework.Caching.Wiki this.CustomSourceUrl = mod.CustomSourceUrl; this.CustomUrl = mod.CustomUrl; this.ContentPackFor = mod.ContentPackFor; - this.MetadataLinks = mod.MetadataLinks; + this.PullRequestUrl = mod.PullRequestUrl; this.Warnings = mod.Warnings; this.DevNote = mod.DevNote; this.Anchor = mod.Anchor; @@ -192,7 +192,7 @@ namespace StardewModdingAPI.Web.Framework.Caching.Wiki CustomUrl = this.CustomUrl, ContentPackFor = this.ContentPackFor, Warnings = this.Warnings, - MetadataLinks = this.MetadataLinks, + PullRequestUrl = this.PullRequestUrl, DevNote = this.DevNote, Anchor = this.Anchor, diff --git a/src/SMAPI.Web/ViewModels/ModModel.cs b/src/SMAPI.Web/ViewModels/ModModel.cs index 2b478c81..56316ab7 100644 --- a/src/SMAPI.Web/ViewModels/ModModel.cs +++ b/src/SMAPI.Web/ViewModels/ModModel.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using StardewModdingAPI.Toolkit.Framework.Clients.Wiki; @@ -38,8 +37,8 @@ namespace StardewModdingAPI.Web.ViewModels /// <summary>The human-readable warnings for players about this mod.</summary> public string[] Warnings { get; set; } - /// <summary>Extra metadata links (usually for open pull requests).</summary> - public Tuple<Uri, string>[] MetadataLinks { get; set; } + /// <summary>The URL of the pull request which submits changes for an unofficial update to the author, if any.</summary> + public string PullRequestUrl { get; set; } /// <summary>Special notes intended for developers who maintain unofficial updates or submit pull requests. </summary> public string DevNote { get; set; } @@ -68,7 +67,7 @@ namespace StardewModdingAPI.Web.ViewModels this.BetaCompatibility = entry.BetaCompatibility != null ? new ModCompatibilityModel(entry.BetaCompatibility) : null; this.ModPages = this.GetModPageUrls(entry).ToArray(); this.Warnings = entry.Warnings; - this.MetadataLinks = entry.MetadataLinks; + this.PullRequestUrl = entry.PullRequestUrl; this.DevNote = entry.DevNote; this.Slug = entry.Anchor; } diff --git a/src/SMAPI.Web/Views/Mods/Index.cshtml b/src/SMAPI.Web/Views/Mods/Index.cshtml index 50b59b45..5b310d55 100644 --- a/src/SMAPI.Web/Views/Mods/Index.cshtml +++ b/src/SMAPI.Web/Views/Mods/Index.cshtml @@ -110,11 +110,8 @@ else <small> <a v-bind:href="'#' + mod.Slug">#</a> <span v-show="showAdvanced"> - <template v-for="(link, i) in mod.MetadataLinks"> - <a v-bind:href="link.Item1">{{link.Item2}}</a> - </template> - - <abbr v-bind:title="mod.DevNote" v-show="mod.DevNote">[dev note]</abbr> + <a v-bind:href="mod.PullRequestUrl" v-if="mod.PullRequestUrl">PR</a> + <abbr v-bind:title="mod.DevNote" v-if="mod.DevNote">[dev note]</abbr> </span> </small> </td> |