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:
parent
821f65c381
commit
9d630e446e
@ -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>();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user