migrated api endpoints over to UEDB

This commit is contained in:
Asval 2025-10-10 14:03:38 +02:00
parent 407be3d1a7
commit a4e92b6c59
3 changed files with 16 additions and 6 deletions

@ -1 +1 @@
Subproject commit 2a200048c73d5381718e240f35a074186cc857cd
Subproject commit aa9ce2eb0e0dc9dee5f1e848c78d811246818c55

View File

@ -16,8 +16,8 @@ public class EndpointSettings : ViewModel
case "Fortnite [LIVE]":
return new EndpointSettings[]
{
new("https://fortnitecentral.genxgames.gg/api/v1/aes", "$.['mainKey','dynamicKeys']"),
new("https://fortnitecentral.genxgames.gg/api/v1/mappings", "$.[0].['url','fileName']") // just get the first available, not just oodle! (Unfortunately not default except when resetting settings)
new("https://uedb.dev/svc/api/v1/fortnite/aes", "$.['mainKey','dynamicKeys']"),
new("https://uedb.dev/svc/api/v1/fortnite/mappings", "$.mappings.Brotli")
};
default:
return new EndpointSettings[] { new(), new() };
@ -106,4 +106,4 @@ public class EndpointSettings : ViewModel
}
}
}
}
}

View File

@ -321,6 +321,9 @@ public class CUE4ParseViewModel : ViewModel
await _threadWorkerView.Begin(cancellationToken =>
{
// deprecated values
if (endpoint.Url == "https://fortnitecentral.genxgames.gg/api/v1/aes") endpoint.Url = "https://uedb.dev/svc/api/v1/fortnite/aes";
var aes = _apiEndpointView.DynamicApi.GetAesKeys(cancellationToken, endpoint.Url, endpoint.Path);
if (aes is not { IsValid: true }) return;
@ -362,8 +365,15 @@ public class CUE4ParseViewModel : ViewModel
}
else if (endpoint.IsValid)
{
var mappingsFolder = Path.Combine(UserSettings.Default.OutputDirectory, ".data");
// deprecated values
if (endpoint.Path == "$.[?(@.meta.compressionMethod=='Oodle')].['url','fileName']") endpoint.Path = "$.[0].['url','fileName']";
if (endpoint.Url == "https://fortnitecentral.genxgames.gg/api/v1/mappings")
{
endpoint.Url = "https://uedb.dev/svc/api/v1/fortnite/mappings";
endpoint.Path = "$.mappings.Brotli";
}
var mappingsFolder = Path.Combine(UserSettings.Default.OutputDirectory, ".data");
var mappings = _apiEndpointView.DynamicApi.GetMappings(CancellationToken.None, endpoint.Url, endpoint.Path);
if (mappings is { Length: > 0 })
{
@ -372,7 +382,7 @@ public class CUE4ParseViewModel : ViewModel
if (!mapping.IsValid) continue;
var mappingPath = Path.Combine(mappingsFolder, mapping.FileName);
if (force || !File.Exists(mappingPath))
if (force || !File.Exists(mappingPath) || new FileInfo(mappingPath).Length == 0)
{
_apiEndpointView.DownloadFile(mapping.Url, mappingPath);
}