From fb3f324e5b9ad4127910638e5f07697203cd8ac5 Mon Sep 17 00:00:00 2001 From: Chien Zhang Date: Tue, 12 Sep 2023 21:32:14 +0800 Subject: [PATCH] =?UTF-8?q?CurseForge=E7=9C=9F=E4=BB=A4=E4=BA=BA=E5=A4=B4?= =?UTF-8?q?=E7=96=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelogs/v0.5.md | 3 +++ src/Polymerium.App (Package)/Package.appxmanifest | 2 +- src/Polymerium.App/Services/ImportService.cs | 4 ++-- src/Polymerium.Core/Helpers/CurseForgeHelper.cs | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/changelogs/v0.5.md b/changelogs/v0.5.md index 1074979b..d2e60182 100644 --- a/changelogs/v0.5.md +++ b/changelogs/v0.5.md @@ -2,9 +2,12 @@ ## --- +## v0.5.1 + - **修复**元数据包含中文同样能被识别(但不建议) - **优化**错误和警告消息将不会自动消失 - **新增**实例能强制导入整合包并整合覆盖原先数据 +- **修复**配合CurseForge添加的6652号无文档的Api ## v0.5.0 diff --git a/src/Polymerium.App (Package)/Package.appxmanifest b/src/Polymerium.App (Package)/Package.appxmanifest index db19afbd..c1c85f05 100644 --- a/src/Polymerium.App (Package)/Package.appxmanifest +++ b/src/Polymerium.App (Package)/Package.appxmanifest @@ -9,7 +9,7 @@ + Version="0.5.1.0"/> Polymerium diff --git a/src/Polymerium.App/Services/ImportService.cs b/src/Polymerium.App/Services/ImportService.cs index 257f8546..66099018 100644 --- a/src/Polymerium.App/Services/ImportService.cs +++ b/src/Polymerium.App/Services/ImportService.cs @@ -94,7 +94,7 @@ public async Task> ExtractMetadataFromFile return new Result(GameImportError.Unsupported); } - catch + catch(Exception ex) { return new Result(GameImportError.FileSystemError); } @@ -139,7 +139,7 @@ public async Task> ExtractMetadataFromFile allocateds.Add(new Uri(new Uri("poly-res://local@file/"), file.Path)); } } - catch + catch(Exception ex) { return GameImportError.FileSystemError; } diff --git a/src/Polymerium.Core/Helpers/CurseForgeHelper.cs b/src/Polymerium.Core/Helpers/CurseForgeHelper.cs index 144908f4..85996b1d 100644 --- a/src/Polymerium.Core/Helpers/CurseForgeHelper.cs +++ b/src/Polymerium.Core/Helpers/CurseForgeHelper.cs @@ -59,6 +59,7 @@ public static ResourceType GetResourceTypeFromClassId(uint classId) 17 => ResourceType.World, 4546 => ResourceType.ShaderPack, 4471 => ResourceType.Modpack, + 6552 => ResourceType.ShaderPack, _ => throw new NotImplementedException() }; } @@ -182,7 +183,7 @@ public static async Task> SearchProjectsAsync( ResourceType.ResourcePack => CLASSID_RESOURCEPACK, ResourceType.World => CLASSID_WORLD, _ => throw new NotSupportedException() - }}&index={offset}&pageSize={limit}&searchFilter={HttpUtility.UrlEncode(query)}&sortField=2&sortOrder=desc" + }}&index={offset}&pageSize={limit}&searchFilter={HttpUtility.UrlPathEncode(query)}&sortField=2&sortOrder=desc" + (gameVersion != null ? $"&gameVersion={gameVersion}" : "") + ( (type == ResourceType.Mod || type == ResourceType.Modpack) && modLoaderId != null