fix: ota update wrong path & version

This commit is contained in:
Yifan Liu
2023-03-04 00:44:56 -06:00
parent 13e69ed84b
commit 5f12e1cef0

View File

@@ -95,14 +95,14 @@ namespace MaaWpfGui
JObject tasksJsonClient = null;
if (clientType != "Official" && tasksJson != null)
{
tasksPath = clientType + '/' + tasksPath;
tasksPath = "resource/global/" + clientType + '/' + tasksPath;
tasksJsonClient = fromWeb ? WebService.RequestMaaApiWithCache(tasksPath) : WebService.RequestMaaApiWithCache(tasksPath);
}
bool isDebugVersion = Marshal.PtrToStringAnsi(AsstGetVersion()) == "DEBUG VERSION";
bool curVerParsed = !isDebugVersion ?
SemVersion.TryParse(Marshal.PtrToStringAnsi(AsstGetVersion()), SemVersionStyles.AllowLowerV, out var curVersionObj) :
SemVersion.TryParse("4.11.7", SemVersionStyles.AllowLowerV, out curVersionObj);
SemVersion.TryParse("5.1.7", SemVersionStyles.AllowLowerV, out curVersionObj);
bool curResourceVerParsed = SemVersion.TryParse(
tasksJsonClient?["ResourceVersion"]?.ToString() ?? tasksJson?["ResourceVersion"]?.ToString() ?? string.Empty,
SemVersionStyles.AllowLowerV, out var curResourceVersionObj);