diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-07-30 14:21:18 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-09-14 18:59:39 -0400 |
commit | b802471dd428546c7a5d9a121f2be93425cc1cd4 (patch) | |
tree | 59e9ae869d3691d6ce6808aa94b2c2121b18ae55 /src | |
parent | 4bb644e46e579c7d49306cbb0692521e3027264b (diff) | |
download | SMAPI-b802471dd428546c7a5d9a121f2be93425cc1cd4.tar.gz SMAPI-b802471dd428546c7a5d9a121f2be93425cc1cd4.tar.bz2 SMAPI-b802471dd428546c7a5d9a121f2be93425cc1cd4.zip |
remove soft GitHub lookups during update checks (#651)
This caused incorrect update alerts for repositories that contain multiple mods but still use releases.
Diffstat (limited to 'src')
-rw-r--r-- | src/SMAPI.Web/Controllers/ModsApiController.cs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/SMAPI.Web/Controllers/ModsApiController.cs b/src/SMAPI.Web/Controllers/ModsApiController.cs index 13dd5529..b22dc258 100644 --- a/src/SMAPI.Web/Controllers/ModsApiController.cs +++ b/src/SMAPI.Web/Controllers/ModsApiController.cs @@ -125,18 +125,11 @@ namespace StardewModdingAPI.Web.Controllers WikiModEntry wikiEntry = wikiData.FirstOrDefault(entry => entry.ID.Contains(search.ID.Trim(), StringComparer.InvariantCultureIgnoreCase)); UpdateKey[] updateKeys = this.GetUpdateKeys(search.UpdateKeys, record, wikiEntry).ToArray(); - // add soft lookups (don't log errors if the target doesn't exist) - UpdateKey[] softUpdateKeys = updateKeys.All(key => key.Repository != ModRepositoryKey.GitHub) && !string.IsNullOrWhiteSpace(wikiEntry?.GitHubRepo) - ? new[] { new UpdateKey(ModRepositoryKey.GitHub, wikiEntry.GitHubRepo) } - : new UpdateKey[0]; - // get latest versions ModEntryModel result = new ModEntryModel { ID = search.ID }; IList<string> errors = new List<string>(); - foreach (UpdateKey updateKey in updateKeys.Concat(softUpdateKeys)) + foreach (UpdateKey updateKey in updateKeys) { - bool isSoftLookup = softUpdateKeys.Contains(updateKey); - // validate update key if (!updateKey.LooksValid) { @@ -148,7 +141,7 @@ namespace StardewModdingAPI.Web.Controllers ModInfoModel data = await this.GetInfoForUpdateKeyAsync(updateKey); if (data.Error != null) { - if (!isSoftLookup || data.Status != RemoteModStatus.DoesNotExist) + if (data.Status != RemoteModStatus.DoesNotExist) errors.Add(data.Error); continue; } |