Skip to content

Commit

Permalink
Merge #3451 Allow overriding resources.remote-avc
Browse files Browse the repository at this point in the history
  • Loading branch information
DasSkelett committed Jan 23, 2022
2 parents dd1a8e7 + 2e43c94 commit 89be681
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
12 changes: 8 additions & 4 deletions Netkan/Transformers/AvcTransformer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,17 @@ public IEnumerable<Metadata> 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
Expand Down
2 changes: 1 addition & 1 deletion Spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 89be681

Please sign in to comment.