mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Add ability to import files from a stream.
This commit is contained in:
@ -395,6 +395,17 @@ namespace osu.Game
|
||||
}
|
||||
}
|
||||
|
||||
public async Task Import(Stream stream, string filename)
|
||||
{
|
||||
var extension = Path.GetExtension(filename)?.ToLowerInvariant();
|
||||
|
||||
foreach (var importer in fileImporters)
|
||||
{
|
||||
if (importer.HandledExtensions.Contains(extension))
|
||||
await importer.Import(stream, Path.GetFileNameWithoutExtension(filename));
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<string> HandledExtensions => fileImporters.SelectMany(i => i.HandledExtensions);
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
Reference in New Issue
Block a user