File tree Expand file tree Collapse file tree 2 files changed +26
-5
lines changed
Expand file tree Collapse file tree 2 files changed +26
-5
lines changed Original file line number Diff line number Diff line change 11using System . Xml ;
2+ using Microsoft . VisualBasic . FileIO ;
23using Sitreamai . Models ;
34
45namespace MaiChartManager . Models ;
@@ -97,4 +98,29 @@ public List<string> Problems
9798 return res ;
9899 }
99100 }
101+
102+ public void Delete ( )
103+ {
104+ if ( HasJacket )
105+ {
106+ FileSystem . DeleteFile ( JacketPath , UIOption . OnlyErrorDialogs , RecycleOption . SendToRecycleBin ) ;
107+ }
108+
109+ if ( StaticSettings . AcbAwb . TryGetValue ( $ "music{ NonDxId : 000000} .acb", out var acb ) )
110+ {
111+ FileSystem . DeleteFile ( acb , UIOption . OnlyErrorDialogs , RecycleOption . SendToRecycleBin ) ;
112+ }
113+
114+ if ( StaticSettings . AcbAwb . TryGetValue ( $ "music{ NonDxId : 000000} .awb", out var awb ) )
115+ {
116+ FileSystem . DeleteFile ( awb , UIOption . OnlyErrorDialogs , RecycleOption . SendToRecycleBin ) ;
117+ }
118+
119+ if ( StaticSettings . MovieDataMap . TryGetValue ( NonDxId , out var movieData ) )
120+ {
121+ FileSystem . DeleteFile ( movieData , UIOption . OnlyErrorDialogs , RecycleOption . SendToRecycleBin ) ;
122+ }
123+
124+ FileSystem . DeleteDirectory ( Path . GetDirectoryName ( FilePath ) , UIOption . OnlyErrorDialogs , RecycleOption . SendToRecycleBin ) ;
125+ }
100126}
Original file line number Diff line number Diff line change @@ -453,9 +453,4 @@ public void Save()
453453 Modified = false ;
454454 xmlDoc . Save ( FilePath ) ;
455455 }
456-
457- public void Delete ( )
458- {
459- FileSystem . DeleteDirectory ( Path . GetDirectoryName ( FilePath ) , UIOption . OnlyErrorDialogs , RecycleOption . SendToRecycleBin ) ;
460- }
461456}
You can’t perform that action at this time.
0 commit comments