1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 21:43:04 +08:00

Standardize AudioFile and BackgroundImage paths

This commit is contained in:
HoLLy 2018-10-09 17:49:18 +02:00
parent 97f8619301
commit b35f88b8ba

View File

@ -5,6 +5,7 @@ using System;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using osu.Framework.IO.File;
using osu.Game.Beatmaps.Timing; using osu.Game.Beatmaps.Timing;
using osu.Game.Rulesets.Objects.Legacy; using osu.Game.Rulesets.Objects.Legacy;
using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.ControlPoints;
@ -100,7 +101,7 @@ namespace osu.Game.Beatmaps.Formats
switch (pair.Key) switch (pair.Key)
{ {
case @"AudioFilename": case @"AudioFilename":
metadata.AudioFile = pair.Value; metadata.AudioFile = FileSafety.PathStandardise(pair.Value);
break; break;
case @"AudioLeadIn": case @"AudioLeadIn":
beatmap.BeatmapInfo.AudioLeadIn = int.Parse(pair.Value); beatmap.BeatmapInfo.AudioLeadIn = int.Parse(pair.Value);
@ -256,7 +257,7 @@ namespace osu.Game.Beatmaps.Formats
{ {
case EventType.Background: case EventType.Background:
string filename = split[2].Trim('"'); string filename = split[2].Trim('"');
beatmap.BeatmapInfo.Metadata.BackgroundFile = filename; beatmap.BeatmapInfo.Metadata.BackgroundFile = FileSafety.PathStandardise(filename);
break; break;
case EventType.Break: case EventType.Break:
var breakEvent = new BreakPeriod var breakEvent = new BreakPeriod