summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModModel.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2023-01-29 16:37:23 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2023-01-29 16:37:23 -0500
commit3eb98b565f48c26384f0e83e4012fc9b40f1d819 (patch)
treef88ae302c3b0913228fb18dcd2a2babf14134ada /src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModModel.cs
parent610e2722c6687591faacb942d6f752c5f3c620d7 (diff)
downloadSMAPI-3eb98b565f48c26384f0e83e4012fc9b40f1d819.tar.gz
SMAPI-3eb98b565f48c26384f0e83e4012fc9b40f1d819.tar.bz2
SMAPI-3eb98b565f48c26384f0e83e4012fc9b40f1d819.zip
simplify & validate manifest mod page URLs
This avoids an issue where users are told to download it from the JSON manifest URL.
Diffstat (limited to 'src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModModel.cs')
-rw-r--r--src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModModel.cs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModModel.cs b/src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModModel.cs
index ee1fbeb6..418fb26b 100644
--- a/src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModModel.cs
+++ b/src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModModel.cs
@@ -1,4 +1,6 @@
// Copyright 2022 Jamie Taylor
+using System;
+
namespace StardewModdingAPI.Web.Framework.Clients.UpdateManifest.ResponseModels
{
/// <summary>The data model for a mod in an update manifest file.</summary>
@@ -11,10 +13,10 @@ namespace StardewModdingAPI.Web.Framework.Clients.UpdateManifest.ResponseModels
public string? Name { get; }
/// <summary>The mod page URL from which to download updates.</summary>
- public string? Url { get; }
+ public string? ModPageUrl { get; }
/// <summary>The available versions for this mod.</summary>
- public UpdateManifestVersionModel[]? Versions { get; }
+ public UpdateManifestVersionModel[] Versions { get; }
/*********
@@ -22,13 +24,13 @@ namespace StardewModdingAPI.Web.Framework.Clients.UpdateManifest.ResponseModels
*********/
/// <summary>Construct an instance.</summary>
/// <param name="name">The mod's name.</param>
- /// <param name="url">The mod page URL from which to download updates.</param>
+ /// <param name="modPageUrl">The mod page URL from which to download updates.</param>
/// <param name="versions">The available versions for this mod.</param>
- public UpdateManifestModModel(string? name, string? url, UpdateManifestVersionModel[]? versions)
+ public UpdateManifestModModel(string? name, string? modPageUrl, UpdateManifestVersionModel[]? versions)
{
this.Name = name;
- this.Url = url;
- this.Versions = versions;
+ this.ModPageUrl = modPageUrl;
+ this.Versions = versions ?? Array.Empty<UpdateManifestVersionModel>();
}
}
}