mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 19:27:26 +08:00
Merge branch 'master' into fix-legacy-song-progress-mouse-blocking
This commit is contained in:
commit
4063f92381
@ -26,6 +26,11 @@ namespace osu.Game.IO
|
||||
/// </summary>
|
||||
public virtual string[] IgnoreFiles => Array.Empty<string>();
|
||||
|
||||
/// <summary>
|
||||
/// A list of file/directory suffixes which should not be migrated.
|
||||
/// </summary>
|
||||
public virtual string[] IgnoreSuffixes => Array.Empty<string>();
|
||||
|
||||
protected MigratableStorage(Storage storage, string subPath = null)
|
||||
: base(storage, subPath)
|
||||
{
|
||||
@ -73,6 +78,9 @@ namespace osu.Game.IO
|
||||
if (topLevelExcludes && IgnoreFiles.Contains(fi.Name))
|
||||
continue;
|
||||
|
||||
if (IgnoreSuffixes.Any(suffix => fi.Name.EndsWith(suffix, StringComparison.Ordinal)))
|
||||
continue;
|
||||
|
||||
allFilesDeleted &= AttemptOperation(() => fi.Delete(), throwOnFailure: false);
|
||||
}
|
||||
|
||||
@ -81,6 +89,9 @@ namespace osu.Game.IO
|
||||
if (topLevelExcludes && IgnoreDirectories.Contains(dir.Name))
|
||||
continue;
|
||||
|
||||
if (IgnoreSuffixes.Any(suffix => dir.Name.EndsWith(suffix, StringComparison.Ordinal)))
|
||||
continue;
|
||||
|
||||
allFilesDeleted &= AttemptOperation(() => dir.Delete(true), throwOnFailure: false);
|
||||
}
|
||||
|
||||
@ -101,6 +112,9 @@ namespace osu.Game.IO
|
||||
if (topLevelExcludes && IgnoreFiles.Contains(fileInfo.Name))
|
||||
continue;
|
||||
|
||||
if (IgnoreSuffixes.Any(suffix => fileInfo.Name.EndsWith(suffix, StringComparison.Ordinal)))
|
||||
continue;
|
||||
|
||||
AttemptOperation(() =>
|
||||
{
|
||||
fileInfo.Refresh();
|
||||
@ -119,6 +133,9 @@ namespace osu.Game.IO
|
||||
if (topLevelExcludes && IgnoreDirectories.Contains(dir.Name))
|
||||
continue;
|
||||
|
||||
if (IgnoreSuffixes.Any(suffix => dir.Name.EndsWith(suffix, StringComparison.Ordinal)))
|
||||
continue;
|
||||
|
||||
CopyRecursive(dir, destination.CreateSubdirectory(dir.Name), false);
|
||||
}
|
||||
}
|
||||
|
@ -38,15 +38,20 @@ namespace osu.Game.IO
|
||||
public override string[] IgnoreDirectories => new[]
|
||||
{
|
||||
"cache",
|
||||
$"{OsuGameBase.CLIENT_DATABASE_FILENAME}.management",
|
||||
};
|
||||
|
||||
public override string[] IgnoreFiles => new[]
|
||||
{
|
||||
"framework.ini",
|
||||
"storage.ini",
|
||||
$"{OsuGameBase.CLIENT_DATABASE_FILENAME}.note",
|
||||
$"{OsuGameBase.CLIENT_DATABASE_FILENAME}.lock",
|
||||
};
|
||||
|
||||
public override string[] IgnoreSuffixes => new[]
|
||||
{
|
||||
// Realm pipe files don't play well with copy operations
|
||||
".note",
|
||||
".lock",
|
||||
".management",
|
||||
};
|
||||
|
||||
public OsuStorage(GameHost host, Storage defaultStorage)
|
||||
|
Loading…
Reference in New Issue
Block a user