From 4fe8a6f1a3fa1d4eb2b561de03376057fcf5f65c Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Sat, 7 Dec 2024 15:14:10 -0600 Subject: [PATCH] Stop trying to get remote version files from the forum --- Netkan/Transformers/AvcTransformer.cs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Netkan/Transformers/AvcTransformer.cs b/Netkan/Transformers/AvcTransformer.cs index 83467dc89..20638a678 100644 --- a/Netkan/Transformers/AvcTransformer.cs +++ b/Netkan/Transformers/AvcTransformer.cs @@ -88,10 +88,17 @@ public IEnumerable Transform(Metadata metadata, TransformOptions? opts try { - if ((_github?.DownloadText(remoteUri) - ?? _http.DownloadText(remoteUri)) is string remoteJson - && JsonConvert.DeserializeObject(remoteJson) is AvcVersion remoteAvc - && avc.version.CompareTo(remoteAvc.version) == 0) + if (BadHosts.Contains(remoteUri.Host)) + { + Log.WarnFormat("AVC host does not contain version files: {0}", + remoteUri.Host); + } + else if ((_github?.DownloadText(remoteUri) + ?? _http.DownloadText(remoteUri)) + is string remoteJson + && JsonConvert.DeserializeObject(remoteJson) + is AvcVersion remoteAvc + && avc.version.Equals(remoteAvc.version)) { // Local AVC and Remote AVC describe the same version, prefer Log.Info("Remote AVC version file describes same version as local AVC version file, using it preferentially."); @@ -161,5 +168,10 @@ public static void ApplyVersions(JObject json, AvcVersion avc) return Net.GetRawUri(remoteUri); } + + private static readonly HashSet BadHosts = new HashSet() + { + "forum.kerbalspaceprogram.com", + }; } }