1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 05:27:23 +08:00

Merge branch 'master' into stable-slider-tick-anims

This commit is contained in:
Dean Herbert 2022-08-01 18:03:22 +09:00
commit 0b8d3cbce9
2 changed files with 17 additions and 3 deletions

View File

@ -702,6 +702,8 @@ namespace osu.Game.Tests.Database
var firstImport = await importer.Import(new ImportTask(pathMissingOneBeatmap));
Assert.That(firstImport, Is.Not.Null);
realm.Run(r => r.Refresh());
Assert.That(realm.Realm.All<BeatmapSetInfo>().Where(s => !s.DeletePending), Has.Count.EqualTo(1));
Assert.That(realm.Realm.All<BeatmapSetInfo>().First(s => !s.DeletePending).Beatmaps, Has.Count.EqualTo(11));
@ -709,6 +711,8 @@ namespace osu.Game.Tests.Database
var secondImport = await importer.Import(new ImportTask(pathOriginal));
Assert.That(secondImport, Is.Not.Null);
realm.Run(r => r.Refresh());
Assert.That(realm.Realm.All<BeatmapInfo>(), Has.Count.EqualTo(23));
Assert.That(realm.Realm.All<BeatmapSetInfo>(), Has.Count.EqualTo(2));

View File

@ -96,12 +96,22 @@ namespace osu.Game.IO
if (!destination.Exists)
Directory.CreateDirectory(destination.FullName);
foreach (System.IO.FileInfo fi in source.GetFiles())
foreach (System.IO.FileInfo fileInfo in source.GetFiles())
{
if (topLevelExcludes && IgnoreFiles.Contains(fi.Name))
if (topLevelExcludes && IgnoreFiles.Contains(fileInfo.Name))
continue;
AttemptOperation(() => fi.CopyTo(Path.Combine(destination.FullName, fi.Name), true));
AttemptOperation(() =>
{
fileInfo.Refresh();
// A temporary file may have been deleted since the initial GetFiles operation.
// We don't want the whole migration process to fail in such a case.
if (!fileInfo.Exists)
return;
fileInfo.CopyTo(Path.Combine(destination.FullName, fileInfo.Name), true);
});
}
foreach (DirectoryInfo dir in source.GetDirectories())