mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 00:23:01 +08:00
Fix import multiple file types via drag potentially reaching the wrong importer
This commit is contained in:
parent
84e1ff79a0
commit
4852630c93
@ -433,12 +433,15 @@ namespace osu.Game
|
|||||||
if (paths.Length == 0)
|
if (paths.Length == 0)
|
||||||
return;
|
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))
|
foreach (var importer in fileImporters)
|
||||||
await importer.Import(paths).ConfigureAwait(false);
|
{
|
||||||
|
if (importer.HandledExtensions.Contains(groups.Key))
|
||||||
|
await importer.Import(groups.ToArray()).ConfigureAwait(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user