mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:23:22 +08:00
Cleanup / re-protect file store
This commit is contained in:
parent
4b8d628000
commit
0e844b3039
@ -616,12 +616,8 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
manager.UpdateFile(setToUpdate, fileToUpdate, stream);
|
manager.UpdateFile(setToUpdate, fileToUpdate, stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that the old file has been dereferenced
|
// Check that the old file reference has been removed
|
||||||
Assert.That(manager.Files.QueryFiles(f => f.ID == fileToUpdate.FileInfoID).SingleOrDefault(), Is.Null);
|
Assert.That(manager.QueryBeatmapSet(s => s.ID == setToUpdate.ID).Files.All(f => f.ID != fileToUpdate.ID));
|
||||||
|
|
||||||
// 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 new file is referenced correctly by attempting a retrieval
|
// 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;
|
Beatmap updatedBeatmap = (Beatmap)manager.GetWorkingBeatmap(manager.QueryBeatmap(b => b.ID == beatmapToUpdate.BeatmapInfo.ID)).Beatmap;
|
||||||
|
@ -68,7 +68,7 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
public virtual bool SupportsImportFromStable => RuntimeInfo.IsDesktop;
|
public virtual bool SupportsImportFromStable => RuntimeInfo.IsDesktop;
|
||||||
|
|
||||||
public readonly FileStore Files;
|
protected readonly FileStore Files;
|
||||||
|
|
||||||
protected readonly IDatabaseContextFactory ContextFactory;
|
protected readonly IDatabaseContextFactory ContextFactory;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user