update mod compatibility page URLs

This commit is contained in:
Jesse Plamondon-Willard 2018-11-04 23:48:55 -05:00
parent a4a1777ca4
commit 724d3fccb1
6 changed files with 10 additions and 10 deletions

View File

@ -47,8 +47,8 @@ namespace StardewModdingAPI.Web.Controllers
/// <summary>The internal mod metadata list.</summary>
private readonly ModDatabase ModDatabase;
/// <summary>The web URL for the wiki compatibility list.</summary>
private readonly string WikiCompatibilityPageUrl;
/// <summary>The web URL for the compatibility list.</summary>
private readonly string CompatibilityPageUrl;
/*********
@ -65,7 +65,7 @@ namespace StardewModdingAPI.Web.Controllers
{
this.ModDatabase = new ModToolkit().GetModDatabase(Path.Combine(environment.WebRootPath, "StardewModdingAPI.metadata.json"));
ModUpdateCheckConfig config = configProvider.Value;
this.WikiCompatibilityPageUrl = config.WikiCompatibilityPageUrl;
this.CompatibilityPageUrl = config.CompatibilityPageUrl;
this.Cache = cache;
this.SuccessCacheMinutes = config.SuccessCacheMinutes;
@ -163,7 +163,7 @@ namespace StardewModdingAPI.Web.Controllers
// get unofficial version
if (wikiEntry?.Compatibility.UnofficialVersion != null && this.IsNewer(wikiEntry.Compatibility.UnofficialVersion, result.Main?.Version) && this.IsNewer(wikiEntry.Compatibility.UnofficialVersion, result.Optional?.Version))
result.Unofficial = new ModEntryVersionModel(wikiEntry.Compatibility.UnofficialVersion, this.WikiCompatibilityPageUrl);
result.Unofficial = new ModEntryVersionModel(wikiEntry.Compatibility.UnofficialVersion, $"{this.CompatibilityPageUrl}/#{wikiEntry.Anchor}");
// get unofficial version for beta
if (wikiEntry?.HasBetaInfo == true)
@ -174,7 +174,7 @@ namespace StardewModdingAPI.Web.Controllers
if (wikiEntry.BetaCompatibility.UnofficialVersion != null)
{
result.UnofficialForBeta = (wikiEntry.BetaCompatibility.UnofficialVersion != null && this.IsNewer(wikiEntry.BetaCompatibility.UnofficialVersion, result.Main?.Version) && this.IsNewer(wikiEntry.BetaCompatibility.UnofficialVersion, result.Optional?.Version))
? new ModEntryVersionModel(wikiEntry.BetaCompatibility.UnofficialVersion, this.WikiCompatibilityPageUrl)
? new ModEntryVersionModel(wikiEntry.BetaCompatibility.UnofficialVersion, $"{this.CompatibilityPageUrl}/#{wikiEntry.Anchor}")
: null;
}
else

View File

@ -17,6 +17,6 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels
public string SemanticVersionRegex { get; set; }
/// <summary>The web URL for the wiki compatibility list.</summary>
public string WikiCompatibilityPageUrl { get; set; }
public string CompatibilityPageUrl { get; set; }
}
}

View File

@ -154,7 +154,7 @@ namespace StardewModdingAPI.Web
// shortcut redirects
redirects.Add(new RedirectToUrlRule(@"^/buildmsg(?:/?(.*))$", "https://github.com/Pathoschild/SMAPI/blob/develop/docs/mod-build-config.md#$1"));
redirects.Add(new RedirectToUrlRule(@"^/compat\.?$", "https://stardewvalleywiki.com/Modding:SMAPI_compatibility"));
redirects.Add(new RedirectToUrlRule(@"^/compat\.?$", "https://mods.smapi.io"));
redirects.Add(new RedirectToUrlRule(@"^/docs\.?$", "https://stardewvalleywiki.com/Modding:Index"));
redirects.Add(new RedirectToUrlRule(@"^/install\.?$", "https://stardewvalleywiki.com/Modding:Player_Guide/Getting_Started#Install_SMAPI"));

View File

@ -48,6 +48,6 @@
"SuccessCacheMinutes": 60,
"ErrorCacheMinutes": 5,
"SemanticVersionRegex": "^(?>(?<major>0|[1-9]\\d*))\\.(?>(?<minor>0|[1-9]\\d*))(?>(?:\\.(?<patch>0|[1-9]\\d*))?)(?:-(?<prerelease>(?>[a-z0-9]+[\\-\\.]?)+))?$",
"WikiCompatibilityPageUrl": "https://smapi.io/compat"
"CompatibilityPageUrl": "https://mods.smapi.io"
}
}

View File

@ -87,7 +87,7 @@ namespace StardewModdingAPI.Framework.ModLoading
updateUrls.Add(mod.DataRecord.AlternativeUrl);
// default update URL
updateUrls.Add("https://smapi.io/compat");
updateUrls.Add("https://mods.smapi.io");
// build error
string error = $"{reasonPhrase}. Please check for a ";

View File

@ -942,7 +942,7 @@ namespace StardewModdingAPI.Framework
}
catch (IncompatibleInstructionException) // details already in trace logs
{
string[] updateUrls = new[] { modDatabase.GetModPageUrlFor(manifest.UniqueID), "https://smapi.io/compat" }.Where(p => p != null).ToArray();
string[] updateUrls = new[] { modDatabase.GetModPageUrlFor(manifest.UniqueID), "https://mods.smapi.io" }.Where(p => p != null).ToArray();
errorReasonPhrase = $"it's no longer compatible. Please check for a new version at {string.Join(" or ", updateUrls)}.";
return false;
}