mirror of
https://github.com/ppy/osu.git
synced 2025-03-18 06:27:18 +08:00
Merge pull request #12390 from peppy/fix-import-multiple-file-types
Fix import multiple file types via drag potentially reaching the wrong importer
This commit is contained in:
commit
d41e3690fc
@ -433,12 +433,15 @@ namespace osu.Game
|
||||
if (paths.Length == 0)
|
||||
return;
|
||||
|
||||
var extension = Path.GetExtension(paths.First())?.ToLowerInvariant();
|
||||
var filesPerExtension = paths.GroupBy(p => Path.GetExtension(p).ToLowerInvariant());
|
||||
|
||||
foreach (var importer in fileImporters)
|
||||
foreach (var groups in filesPerExtension)
|
||||
{
|
||||
if (importer.HandledExtensions.Contains(extension))
|
||||
await importer.Import(paths).ConfigureAwait(false);
|
||||
foreach (var importer in fileImporters)
|
||||
{
|
||||
if (importer.HandledExtensions.Contains(groups.Key))
|
||||
await importer.Import(groups.ToArray()).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user