diff --git a/osu.Game.Tournament.Tests/NonVisual/CustomTourneyDirectoryTest.cs b/osu.Game.Tournament.Tests/NonVisual/CustomTourneyDirectoryTest.cs index 94472a8bc7..d149ec145b 100644 --- a/osu.Game.Tournament.Tests/NonVisual/CustomTourneyDirectoryTest.cs +++ b/osu.Game.Tournament.Tests/NonVisual/CustomTourneyDirectoryTest.cs @@ -87,9 +87,9 @@ 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"); + string videosPath = Path.Combine(oldPath, "Videos"); + string modsPath = Path.Combine(oldPath, "Mods"); + string flagsPath = Path.Combine(oldPath, "Flags"); Directory.CreateDirectory(videosPath); Directory.CreateDirectory(modsPath); @@ -123,9 +123,9 @@ namespace osu.Game.Tournament.Tests.NonVisual string migratedPath = Path.Combine(host.Storage.GetFullPath("."), "tournaments", "default"); - videosPath = Path.Combine(migratedPath, "videos"); - modsPath = Path.Combine(migratedPath, "mods"); - flagsPath = Path.Combine(migratedPath, "flags"); + videosPath = Path.Combine(migratedPath, "Videos"); + modsPath = Path.Combine(migratedPath, "Mods"); + flagsPath = Path.Combine(migratedPath, "Flags"); videoFile = Path.Combine(videosPath, "video.mp4"); modFile = Path.Combine(modsPath, "mod.png"); diff --git a/osu.Game.Tournament/Components/TournamentModIcon.cs b/osu.Game.Tournament/Components/TournamentModIcon.cs index 7c4e9c69a2..0fde263bc8 100644 --- a/osu.Game.Tournament/Components/TournamentModIcon.cs +++ b/osu.Game.Tournament/Components/TournamentModIcon.cs @@ -31,7 +31,7 @@ namespace osu.Game.Tournament.Components [BackgroundDependencyLoader] private void load(TextureStore textures, LadderInfo ladderInfo) { - var customTexture = textures.Get($"mods/{modAcronym}"); + var customTexture = textures.Get($"Mods/{modAcronym}"); if (customTexture != null) { diff --git a/osu.Game.Tournament/IO/TournamentStorage.cs b/osu.Game.Tournament/IO/TournamentStorage.cs index 044b60bbd5..02cf567837 100644 --- a/osu.Game.Tournament/IO/TournamentStorage.cs +++ b/osu.Game.Tournament/IO/TournamentStorage.cs @@ -51,6 +51,23 @@ namespace osu.Game.Tournament.IO Logger.Log("Changing tournament storage: " + GetFullPath(string.Empty)); } + protected override void ChangeTargetStorage(Storage newStorage) + { + // due to an unfortunate oversight, on OSes that are sensitive to pathname casing + // the custom flags directory needed to be named `Flags` (uppercase), + // while custom mods and videos directories needed to be named `mods` and `videos` respectively (lowercase). + // to unify handling to uppercase, move any non-compliant directories automatically for the user to migrate. + // can be removed 20220528 + if (newStorage.ExistsDirectory("flags")) + AttemptOperation(() => Directory.Move(newStorage.GetFullPath("flags"), newStorage.GetFullPath("Flags"))); + if (newStorage.ExistsDirectory("mods")) + AttemptOperation(() => Directory.Move(newStorage.GetFullPath("mods"), newStorage.GetFullPath("Mods"))); + if (newStorage.ExistsDirectory("videos")) + AttemptOperation(() => Directory.Move(newStorage.GetFullPath("videos"), newStorage.GetFullPath("Videos"))); + + base.ChangeTargetStorage(newStorage); + } + public IEnumerable ListTournaments() => AllTournaments.GetDirectories(string.Empty); public override void Migrate(Storage newStorage) diff --git a/osu.Game.Tournament/IO/TournamentVideoResourceStore.cs b/osu.Game.Tournament/IO/TournamentVideoResourceStore.cs index 4b26840b79..964d03220d 100644 --- a/osu.Game.Tournament/IO/TournamentVideoResourceStore.cs +++ b/osu.Game.Tournament/IO/TournamentVideoResourceStore.cs @@ -9,7 +9,7 @@ namespace osu.Game.Tournament.IO public class TournamentVideoResourceStore : NamespacedResourceStore { public TournamentVideoResourceStore(Storage storage) - : base(new StorageBackedResourceStore(storage), "videos") + : base(new StorageBackedResourceStore(storage), "Videos") { AddExtension("m4v"); AddExtension("avi"); diff --git a/osu.Game.Tournament/Screens/TeamIntro/SeedingScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/SeedingScreen.cs index d34a8583b9..cd74a75b10 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/SeedingScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/SeedingScreen.cs @@ -197,7 +197,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro { row.Add(new Sprite { - Texture = textures.Get($"mods/{mods.ToLower()}"), + Texture = textures.Get($"Mods/{mods.ToLower()}"), Scale = new Vector2(0.5f) }); }