feat: 暴露清理方法
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
|
||||
- [ ] 扫描时如果报错,报错信息可能会填满整个窗口,导致Overlay无法关闭。
|
||||
- [ ] 读取时如果报错,没有任何警告,会静默报错。需要有一个界面右下方的toast,或是发送系统通知告知用户遇到了错误。
|
||||
- [ ] 指针化Artwork字段。如果artwork的md5
|
||||
- [x] 指针化Artwork字段。如果artwork的md5
|
||||
- [ ] 本地化框架
|
||||
|
||||
## 技术栈
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using GUI.Services;
|
||||
|
||||
namespace GUI.ViewModels;
|
||||
@@ -60,4 +61,11 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
IsScanning = true;
|
||||
ScanProgressVM.StartScanCommand.Execute(directory);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void CleanOrphanedArtwork()
|
||||
{
|
||||
int count = OCES.Resonance.Core.Database.DeleteOrphanedArtworks();
|
||||
// TODO: 添加用户提示,例如对话框显示 "已清理 {count} 条未使用的资源"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<NativeMenu>
|
||||
<NativeMenuItem Header="Database" IsVisible="True">
|
||||
<NativeMenu>
|
||||
<NativeMenuItem Header="Delete Unused Artworks" Command="{Binding CleanOrphanedArtworkCommand}"></NativeMenuItem>
|
||||
<NativeMenuItem Header="Open database file in Finder..."/>
|
||||
</NativeMenu>
|
||||
</NativeMenuItem>
|
||||
|
||||
Reference in New Issue
Block a user