Update with framework-side storage changes

This commit is contained in:
smoogipoo 2020-07-01 17:12:07 +09:00
parent 3fbb2b3f42
commit ab15b6031d
2 changed files with 6 additions and 4 deletions

View File

@ -24,12 +24,12 @@ public class OsuStorage : WrappedStorage
"storage.ini" "storage.ini"
}; };
public OsuStorage(GameHost host) public OsuStorage(GameHost host, Storage defaultStorage)
: base(host.Storage, string.Empty) : base(defaultStorage, string.Empty)
{ {
this.host = host; this.host = host;
storageConfig = new StorageConfigManager(host.Storage); storageConfig = new StorageConfigManager(defaultStorage);
var customStoragePath = storageConfig.Get<string>(StorageConfig.FullPath); var customStoragePath = storageConfig.Get<string>(StorageConfig.FullPath);

View File

@ -312,11 +312,13 @@ public override void SetHost(GameHost host)
base.SetHost(host); base.SetHost(host);
// may be non-null for certain tests // may be non-null for certain tests
Storage ??= new OsuStorage(host); Storage ??= host.Storage;
LocalConfig ??= new OsuConfigManager(Storage); LocalConfig ??= new OsuConfigManager(Storage);
} }
protected override Storage CreateStorage(GameHost host, Storage defaultStorage) => new OsuStorage(host, defaultStorage);
private readonly List<ICanAcceptFiles> fileImporters = new List<ICanAcceptFiles>(); private readonly List<ICanAcceptFiles> fileImporters = new List<ICanAcceptFiles>();
public async Task Import(params string[] paths) public async Task Import(params string[] paths)