diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-08-14 12:21:40 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-08-14 12:21:40 -0400 |
commit | 4f28ea33bd7cc65485402c5e85259083e86b49e1 (patch) | |
tree | 86c4d8f9272de9a715cfcbf4008f0c09f5a59a21 /src/StardewModdingAPI.Toolkit/Framework | |
parent | 60b41195778af33fd609eab66d9ae3f1d1165e8f (diff) | |
parent | 4dd4efc96fac6a7ab66c14edead10e4fa988040d (diff) | |
download | SMAPI-4f28ea33bd7cc65485402c5e85259083e86b49e1.tar.gz SMAPI-4f28ea33bd7cc65485402c5e85259083e86b49e1.tar.bz2 SMAPI-4f28ea33bd7cc65485402c5e85259083e86b49e1.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Framework')
3 files changed, 1 insertions, 51 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModEntryModel.cs b/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModEntryModel.cs index f3f22b93..2aafe199 100644 --- a/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModEntryModel.cs +++ b/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModEntryModel.cs @@ -1,6 +1,3 @@ -using System; -using Newtonsoft.Json; - namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi { /// <summary>Metadata about a mod.</summary> @@ -26,46 +23,5 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi /// <summary>The errors that occurred while fetching update data.</summary> public string[] Errors { get; set; } = new string[0]; - - /**** - ** Backwards-compatible fields - ****/ - /// <summary>The mod's latest version number.</summary> - [Obsolete("Use " + nameof(ModEntryModel.Main))] - [JsonProperty] - internal string Version { get; private set; } - - /// <summary>The mod's web URL.</summary> - [Obsolete("Use " + nameof(ModEntryModel.Main))] - [JsonProperty] - internal string Url { get; private set; } - - /// <summary>The mod's latest optional release, if newer than <see cref="Version"/>.</summary> - [Obsolete("Use " + nameof(ModEntryModel.Optional))] - [JsonProperty] - internal string PreviewVersion { get; private set; } - - /// <summary>The web URL to the mod's latest optional release, if newer than <see cref="Version"/>.</summary> - [Obsolete("Use " + nameof(ModEntryModel.Optional))] - [JsonProperty] - internal string PreviewUrl { get; private set; } - - - /********* - ** Public methods - *********/ - /// <summary>Set backwards-compatible fields.</summary> - /// <param name="version">The requested API version.</param> - public void SetBackwardsCompatibility(ISemanticVersion version) - { - if (version.IsOlderThan("2.6-beta.19")) - { - this.Version = this.Main?.Version?.ToString(); - this.Url = this.Main?.Url; - - this.PreviewVersion = this.Optional?.Version?.ToString(); - this.PreviewUrl = this.Optional?.Url; - } - } } } diff --git a/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModSeachModel.cs b/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModSeachModel.cs index df0d8457..e352e1cc 100644 --- a/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModSeachModel.cs +++ b/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModSeachModel.cs @@ -1,4 +1,3 @@ -using System; using System.Linq; namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi @@ -9,10 +8,6 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi /********* ** Accessors *********/ - /// <summary>The namespaced mod keys to search.</summary> - [Obsolete] - public string[] ModKeys { get; set; } - /// <summary>The mods for which to find data.</summary> public ModSearchEntryModel[] Mods { get; set; } diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs b/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs index de8d0f02..f1cce4a4 100644 --- a/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs +++ b/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs @@ -51,8 +51,7 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning { try { - manifest = this.JsonHelper.ReadJsonFile<Manifest>(manifestFile.FullName); - if (manifest == null) + if (!this.JsonHelper.ReadJsonFileIfExists<Manifest>(manifestFile.FullName, out manifest)) manifestError = "its manifest is invalid."; } catch (SParseException ex) |