From 0e844b30395e856d25e11997e94e46a27867b3c6 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 14 Jan 2020 19:23:34 +0900 Subject: [PATCH] Cleanup / re-protect file store --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 8 ++------ osu.Game/Database/ArchiveModelManager.cs | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index d6499760a7..fb7164062c 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -616,12 +616,8 @@ public async Task TestUpdateBeatmapFile() manager.UpdateFile(setToUpdate, fileToUpdate, stream); } - // Check that the old file has been dereferenced - Assert.That(manager.Files.QueryFiles(f => f.ID == fileToUpdate.FileInfoID).SingleOrDefault(), Is.Null); - - // Ensure that the old file is deleted upon a cleanup - manager.Files.Cleanup(); - Assert.That(new System.IO.FileInfo(manager.Files.Storage.GetFullPath(fileToUpdate.FileInfo.StoragePath)), Does.Not.Exist); + // Check that the old file reference has been removed + Assert.That(manager.QueryBeatmapSet(s => s.ID == setToUpdate.ID).Files.All(f => f.ID != fileToUpdate.ID)); // Check that the new file is referenced correctly by attempting a retrieval Beatmap updatedBeatmap = (Beatmap)manager.GetWorkingBeatmap(manager.QueryBeatmap(b => b.ID == beatmapToUpdate.BeatmapInfo.ID)).Beatmap; diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index be20b2c2e9..5e237d2ecb 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -68,7 +68,7 @@ public abstract class ArchiveModelManager : ICanAcceptFiles, public virtual bool SupportsImportFromStable => RuntimeInfo.IsDesktop; - public readonly FileStore Files; + protected readonly FileStore Files; protected readonly IDatabaseContextFactory ContextFactory;