1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 01:52: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) if (reset)
{ {
try // in earlier versions we stored beatmaps as solid archives, but not any more.
{ if (Storage.ExistsDirectory("beatmaps"))
foreach (var f in Query<FileInfo>()) Storage.DeleteDirectory("beatmaps");
Storage.Delete(Path.Combine(prefix, f.StoragePath));
} if (Storage.ExistsDirectory(prefix))
catch Storage.DeleteDirectory(prefix);
{
// we don't want to ever crash as a result of a reset operation.
}
Connection.DropTable<FileInfo>(); Connection.DropTable<FileInfo>();
} }