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:
parent
69e75bfa09
commit
3b03a25ea5
@ -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)
|
||||
});
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user