From 5bf17dde9fd244c76a61960f6689741128ed6a60 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 21 May 2022 14:35:07 +0900 Subject: [PATCH 1/2] Fix missing `MutatePath` calls --- osu.Game/IO/WrappedStorage.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/IO/WrappedStorage.cs b/osu.Game/IO/WrappedStorage.cs index d4d9d531fa..a465c215e2 100644 --- a/osu.Game/IO/WrappedStorage.cs +++ b/osu.Game/IO/WrappedStorage.cs @@ -67,12 +67,12 @@ namespace osu.Game.IO public override IEnumerable GetFiles(string path, string pattern = "*") => ToLocalRelative(UnderlyingStorage.GetFiles(MutatePath(path), pattern)); - public override Stream CreateFileSafely(string path) => UnderlyingStorage.CreateFileSafely(path); + public override Stream CreateFileSafely(string path) => UnderlyingStorage.CreateFileSafely(MutatePath(path)); public override Stream GetStream(string path, FileAccess access = FileAccess.Read, FileMode mode = FileMode.OpenOrCreate) => UnderlyingStorage.GetStream(MutatePath(path), access, mode); - public override void Move(string from, string to) => UnderlyingStorage.Move(from, to); + public override void Move(string from, string to) => UnderlyingStorage.Move(MutatePath(from), MutatePath(to)); public override bool OpenFileExternally(string filename) => UnderlyingStorage.OpenFileExternally(MutatePath(filename)); From 72386d9377412eb2ba5adef5e06ade4b389cb2ec Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 21 May 2022 15:15:52 +0900 Subject: [PATCH 2/2] Fix incorrect storage being used in `CreateFileSafely` implementation --- osu.Game/IO/WrappedStorage.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game/IO/WrappedStorage.cs b/osu.Game/IO/WrappedStorage.cs index a465c215e2..5887704768 100644 --- a/osu.Game/IO/WrappedStorage.cs +++ b/osu.Game/IO/WrappedStorage.cs @@ -11,7 +11,7 @@ namespace osu.Game.IO /// /// A storage which wraps another storage and delegates implementation, potentially mutating the lookup path. /// - public class WrappedStorage : Storage + public class WrappedStorage : NativeStorage // TODO: Revert to Storage inheritance after https://github.com/ppy/osu-framework/pull/5189 { protected Storage UnderlyingStorage { get; private set; } @@ -67,8 +67,6 @@ namespace osu.Game.IO public override IEnumerable GetFiles(string path, string pattern = "*") => ToLocalRelative(UnderlyingStorage.GetFiles(MutatePath(path), pattern)); - public override Stream CreateFileSafely(string path) => UnderlyingStorage.CreateFileSafely(MutatePath(path)); - public override Stream GetStream(string path, FileAccess access = FileAccess.Read, FileMode mode = FileMode.OpenOrCreate) => UnderlyingStorage.GetStream(MutatePath(path), access, mode);