Merge branch 'master' into guard-url-protocols

This commit is contained in:
Dean Herbert
2022-12-16 18:23:16 +09:00
45 changed files with 439 additions and 82 deletions

View File

@ -44,7 +44,7 @@ namespace osu.Game.Beatmaps
public override async Task<Live<BeatmapSetInfo>?> ImportAsUpdate(ProgressNotification notification, ImportTask importTask, BeatmapSetInfo original)
{
var imported = await Import(notification, importTask).ConfigureAwait(false);
var imported = await Import(notification, new[] { importTask }).ConfigureAwait(false);
if (!imported.Any())
return null;
@ -203,10 +203,10 @@ namespace osu.Game.Beatmaps
}
}
protected override void PostImport(BeatmapSetInfo model, Realm realm, bool batchImport)
protected override void PostImport(BeatmapSetInfo model, Realm realm, ImportParameters parameters)
{
base.PostImport(model, realm, batchImport);
ProcessBeatmap?.Invoke((model, batchImport));
base.PostImport(model, realm, parameters);
ProcessBeatmap?.Invoke((model, parameters.Batch));
}
private void validateOnlineIds(BeatmapSetInfo beatmapSet, Realm realm)

View File

@ -456,15 +456,15 @@ namespace osu.Game.Beatmaps
public Task Import(params string[] paths) => beatmapImporter.Import(paths);
public Task Import(params ImportTask[] tasks) => beatmapImporter.Import(tasks);
public Task Import(ImportTask[] tasks, ImportParameters parameters = default) => beatmapImporter.Import(tasks, parameters);
public Task<IEnumerable<Live<BeatmapSetInfo>>> Import(ProgressNotification notification, params ImportTask[] tasks) => beatmapImporter.Import(notification, tasks);
public Task<IEnumerable<Live<BeatmapSetInfo>>> Import(ProgressNotification notification, ImportTask[] tasks, ImportParameters parameters = default) => beatmapImporter.Import(notification, tasks, parameters);
public Task<Live<BeatmapSetInfo>?> Import(ImportTask task, bool batchImport = false, CancellationToken cancellationToken = default) =>
beatmapImporter.Import(task, batchImport, cancellationToken);
public Task<Live<BeatmapSetInfo>?> Import(ImportTask task, ImportParameters parameters = default, CancellationToken cancellationToken = default) =>
beatmapImporter.Import(task, parameters, cancellationToken);
public Live<BeatmapSetInfo>? Import(BeatmapSetInfo item, ArchiveReader? archive = null, CancellationToken cancellationToken = default) =>
beatmapImporter.ImportModel(item, archive, false, cancellationToken);
beatmapImporter.ImportModel(item, archive, default, cancellationToken);
public IEnumerable<string> HandledExtensions => beatmapImporter.HandledExtensions;

View File

@ -141,6 +141,9 @@ namespace osu.Game.Beatmaps
try
{
string fileStorePath = BeatmapSetInfo.GetPathForFile(BeatmapInfo.Path);
// TODO: check validity of file
var stream = GetStream(fileStorePath);
if (stream == null)