1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 14:32:55 +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:
Dean Herbert 2017-08-01 10:57:46 +09:00
parent 821f65c381
commit 9d630e446e

View File

@ -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>();
}