feat: 暴露清理方法
This commit is contained in:
@@ -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