mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 05:22:54 +08:00
Move storageconfig set and saving to migrate method
This commit is contained in:
parent
9639ebdd97
commit
0cddb85f1b
@ -80,7 +80,7 @@ namespace osu.Game.Tournament.Tests.NonVisual
|
||||
|
||||
// Recreate the old setup that uses "tournament" as the base path.
|
||||
string oldPath = Path.Combine(osuRoot, "tournament");
|
||||
|
||||
|
||||
string videosPath = Path.Combine(oldPath, "videos");
|
||||
string modsPath = Path.Combine(oldPath, "mods");
|
||||
string flagsPath = Path.Combine(oldPath, "flags");
|
||||
|
@ -11,16 +11,17 @@ namespace osu.Game.Tournament.IO
|
||||
{
|
||||
public class TournamentStorage : MigratableStorage
|
||||
{
|
||||
private readonly Storage storage;
|
||||
public TournamentVideoResourceStore VideoStore { get; }
|
||||
private const string default_tournament = "default";
|
||||
private readonly Storage storage;
|
||||
private readonly TournamentStorageManager storageConfig;
|
||||
public TournamentVideoResourceStore VideoStore { get; }
|
||||
|
||||
public TournamentStorage(Storage storage)
|
||||
: base(storage.GetStorageForDirectory("tournaments"), string.Empty)
|
||||
{
|
||||
this.storage = storage;
|
||||
|
||||
TournamentStorageManager storageConfig = new TournamentStorageManager(storage);
|
||||
storageConfig = new TournamentStorageManager(storage);
|
||||
|
||||
if (storage.Exists("tournament.ini"))
|
||||
{
|
||||
@ -29,8 +30,6 @@ namespace osu.Game.Tournament.IO
|
||||
else
|
||||
{
|
||||
Migrate(GetFullPath(default_tournament));
|
||||
storageConfig.Set(StorageConfig.CurrentTournament, default_tournament);
|
||||
storageConfig.Save();
|
||||
ChangeTargetStorage(UnderlyingStorage.GetStorageForDirectory(default_tournament));
|
||||
}
|
||||
|
||||
@ -54,6 +53,8 @@ namespace osu.Game.Tournament.IO
|
||||
moveFileIfExists("drawings.txt", destination);
|
||||
moveFileIfExists("drawings_results.txt", destination);
|
||||
moveFileIfExists("drawings.ini", destination);
|
||||
storageConfig.Set(StorageConfig.CurrentTournament, default_tournament);
|
||||
storageConfig.Save();
|
||||
}
|
||||
|
||||
private void moveFileIfExists(string file, DirectoryInfo destination)
|
||||
|
Loading…
Reference in New Issue
Block a user