diff --git a/README.md b/README.md index df98000..ce69f11 100755 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ - [ ] 扫描时如果报错,报错信息可能会填满整个窗口,导致Overlay无法关闭。 - [ ] 读取时如果报错,没有任何警告,会静默报错。需要有一个界面右下方的toast,或是发送系统通知告知用户遇到了错误。 -- [ ] 指针化Artwork字段。如果artwork的md5 +- [x] 指针化Artwork字段。如果artwork的md5 - [ ] 本地化框架 ## 技术栈 diff --git a/src/GUI/ViewModels/MainWindowViewModel.cs b/src/GUI/ViewModels/MainWindowViewModel.cs index 28db2a9..c05d28e 100644 --- a/src/GUI/ViewModels/MainWindowViewModel.cs +++ b/src/GUI/ViewModels/MainWindowViewModel.cs @@ -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} 条未使用的资源" + } } diff --git a/src/GUI/Views/MainWindow.axaml b/src/GUI/Views/MainWindow.axaml index 33099f0..4ffccdb 100644 --- a/src/GUI/Views/MainWindow.axaml +++ b/src/GUI/Views/MainWindow.axaml @@ -21,6 +21,7 @@ +