Skip to content

Commit 26d91fd

Browse files
committed
feat: 在资源管理器中显示
1 parent 55e12a0 commit 26d91fd

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

MaiChartManager/Controllers/MusicController.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.IO.Compression;
1+
using System.Diagnostics;
2+
using System.IO.Compression;
23
using System.Text.Json;
34
using System.Text.Json.Serialization;
45
using AssetStudio;
@@ -189,4 +190,14 @@ public ActionResult GetJacket(int id)
189190
var texture = asset as Texture2D;
190191
return File(texture.ConvertToStream(ImageFormat.Png, true).GetBuffer(), "image/png");
191192
}
193+
194+
[HttpPost]
195+
public void RequestOpenExplorer(int id)
196+
{
197+
var music = settings.MusicList.Find(it => it.Id == id);
198+
if (music != null)
199+
{
200+
Process.Start("explorer.exe", $"/select,\"{music.FilePath}\"");
201+
}
202+
}
192203
}

MaiChartManager/Front/src/client/apiGen.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,20 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
15451545
...params,
15461546
}),
15471547

1548+
/**
1549+
* No description
1550+
*
1551+
* @tags Music
1552+
* @name RequestOpenExplorer
1553+
* @request POST:/MaiChartManagerServlet/RequestOpenExplorerApi/{id}
1554+
*/
1555+
RequestOpenExplorer: (id: number, params: RequestParams = {}) =>
1556+
this.request<void, any>({
1557+
path: `/MaiChartManagerServlet/RequestOpenExplorerApi/${id}`,
1558+
method: "POST",
1559+
...params,
1560+
}),
1561+
15481562
/**
15491563
* No description
15501564
*

MaiChartManager/Front/src/components/MusicSelectedTopRightToolbar/CopyToButton.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const getSubDirFile = async (folderHandle: FileSystemDirectoryHandle, fileName:
1818
enum DROPDOWN_OPTIONS {
1919
exportZip,
2020
changeId,
21+
showExplorer
2122
}
2223

2324
export default defineComponent({
@@ -35,6 +36,10 @@ export default defineComponent({
3536
{
3637
label: '修改 ID',
3738
key: DROPDOWN_OPTIONS.changeId,
39+
},
40+
{
41+
label: '在资源管理器中显示',
42+
key: DROPDOWN_OPTIONS.showExplorer,
3843
}
3944
])
4045

@@ -47,6 +52,9 @@ export default defineComponent({
4752
}
4853
showChangeId.value = true;
4954
break;
55+
case DROPDOWN_OPTIONS.showExplorer:
56+
api.RequestOpenExplorer(selectMusicId.value);
57+
break;
5058
}
5159
}
5260

0 commit comments

Comments
 (0)