diff --git a/CHANGELOG.md b/CHANGELOG.md index 9da789787c..cc1a1a864f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ All notable changes to this project will be documented in this file. - [Netkan] Enforce spec version requirements for more install properties (#3494 by: HebaruSan; reviewed: techman83) - [Build] Rename GH1866 test, fix invalid char test, fix equality assertion order (#3509 by: HebaruSan; reviewed: DasSkelett) - [Netkan] Enforce a few more spec version requirements (#3505 by: HebaruSan; reviewed: DasSkelett) +- [Netkan] Allow overriding resources.remote-avc (#3451 by: HebaruSan; reviewed: DasSkelett) ## v1.30.4 (Hubble) diff --git a/Netkan/Transformers/AvcTransformer.cs b/Netkan/Transformers/AvcTransformer.cs index dab672a608..d9b64bd5fe 100644 --- a/Netkan/Transformers/AvcTransformer.cs +++ b/Netkan/Transformers/AvcTransformer.cs @@ -69,13 +69,17 @@ public IEnumerable Transform(Metadata metadata, TransformOptions opts) { Log.Info("Found internal AVC version file"); - var remoteUri = GetRemoteAvcUri(avc); + var resourcesJson = (JObject)json["resources"]; + var remoteUri = resourcesJson?["remote-avc"] != null + ? new Uri((string)resourcesJson["remote-avc"]) + : GetRemoteAvcUri(avc); if (remoteUri != null) { - if (json["resources"] == null) - json["resources"] = new JObject(); - var resourcesJson = (JObject)json["resources"]; + if (resourcesJson == null) + { + json["resources"] = resourcesJson = new JObject(); + } resourcesJson.SafeAdd("remote-avc", remoteUri.OriginalString); try diff --git a/Spec.md b/Spec.md index c411b72d70..e632bc486c 100644 --- a/Spec.md +++ b/Spec.md @@ -616,7 +616,7 @@ are described. Unless specified otherwise, these are URLs: - `curse` : (**v1.20**) The mod on Curse. - `manual` : The mod's manual, if it exists. - `metanetkan` : (**v1.27**) URL of the module's remote hosted netkan -- `remote-avc` : URL of remote version file +- `remote-avc` : URL of remote version file. If set in the netkan file, will be used to find the online copy of the version file. Otherwise the `URL` property from the internal version file will be assigned to this field and used instead. - `store`: (**v1.28**) URL where you can purchase a DLC - `steamstore`: (**v1.28**) URL where you can purchase a DLC on Steam