1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Fix beatmaps with subfolders importing incorrectly on windows

Closes #2718.
This commit is contained in:
Dean Herbert 2018-06-05 11:28:51 +09:00
parent 69e75bfa09
commit 3b03a25ea5
2 changed files with 5 additions and 4 deletions

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using osu.Framework.IO.File;
using osu.Framework.Logging;
using osu.Framework.Platform;
using osu.Game.IO;
@ -364,7 +365,7 @@ namespace osu.Game.Database
using (Stream s = reader.GetStream(file))
fileInfos.Add(new TFileModel
{
Filename = file,
Filename = FileSafety.PathSanitise(file),
FileInfo = files.Add(s)
});

View File

@ -4,7 +4,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using osu.Framework.IO.File;
namespace osu.Game.IO.Archives
{
@ -15,7 +14,8 @@ namespace osu.Game.IO.Archives
{
private readonly string path;
public LegacyFilesystemReader(string path) : base(Path.GetFileName(path))
public LegacyFilesystemReader(string path)
: base(Path.GetFileName(path))
{
this.path = path;
}
@ -27,7 +27,7 @@ namespace osu.Game.IO.Archives
// no-op
}
public override IEnumerable<string> Filenames => Directory.GetFiles(path, "*", SearchOption.AllDirectories).Select(f => FileSafety.GetRelativePath(f, path)).ToArray();
public override IEnumerable<string> Filenames => Directory.GetFiles(path, "*", SearchOption.AllDirectories).Select(f => f.Replace(path, string.Empty).Trim(Path.DirectorySeparatorChar)).ToArray();
public override Stream GetUnderlyingStream() => null;
}