mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +08:00
Use new storage methods to reset FileStore
Guarantees that backing files are cleaned up correctly. Also handles lingering "beatmaps" directory from older builds.
This commit is contained in:
parent
821f65c381
commit
9d630e446e
@ -38,15 +38,12 @@ namespace osu.Game.IO
|
||||
{
|
||||
if (reset)
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (var f in Query<FileInfo>())
|
||||
Storage.Delete(Path.Combine(prefix, f.StoragePath));
|
||||
}
|
||||
catch
|
||||
{
|
||||
// we don't want to ever crash as a result of a reset operation.
|
||||
}
|
||||
// in earlier versions we stored beatmaps as solid archives, but not any more.
|
||||
if (Storage.ExistsDirectory("beatmaps"))
|
||||
Storage.DeleteDirectory("beatmaps");
|
||||
|
||||
if (Storage.ExistsDirectory(prefix))
|
||||
Storage.DeleteDirectory(prefix);
|
||||
|
||||
Connection.DropTable<FileInfo>();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user