mirror of
https://github.com/osukey/osukey.git
synced 2025-06-29 07:07:55 +09:00
Check if path can be imported before trying
This commit is contained in:
parent
ef2e93d5c7
commit
0cb66d522a
@ -150,7 +150,7 @@ namespace osu.Game.Database
|
||||
|
||||
var imported = new List<TModel>();
|
||||
|
||||
await Task.WhenAll(paths.Select(async path =>
|
||||
await Task.WhenAll(paths.Where(canImportPath).Select(async path =>
|
||||
{
|
||||
notification.CancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
@ -160,7 +160,6 @@ namespace osu.Game.Database
|
||||
|
||||
lock (imported)
|
||||
{
|
||||
if (model != null)
|
||||
imported.Add(model);
|
||||
current++;
|
||||
|
||||
@ -201,6 +200,8 @@ namespace osu.Game.Database
|
||||
|
||||
notification.State = ProgressNotificationState.Completed;
|
||||
}
|
||||
|
||||
bool canImportPath(string path) => StableDirectoryBased || HandledExtensions.Any(ext => Path.GetExtension(path)?.ToLowerInvariant() == ext);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user