1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 22:37:21 +08:00

Rename Import(TModel) to ImportModel to differentiate from other import methods

This commit is contained in:
Dean Herbert 2022-06-20 15:18:07 +09:00
parent a6c8a832aa
commit 92f1a2958c
6 changed files with 9 additions and 9 deletions

View File

@ -745,7 +745,7 @@ namespace osu.Game.Tests.Database
}
};
var imported = importer.Import(toImport);
var imported = importer.ImportModel(toImport);
realm.Run(r => r.Refresh());

View File

@ -227,10 +227,10 @@ namespace osu.Game.Tests.Online
this.testBeatmapManager = testBeatmapManager;
}
public override Live<BeatmapSetInfo> Import(BeatmapSetInfo item, ArchiveReader archive = null, bool batchImport = false, CancellationToken cancellationToken = default)
public override Live<BeatmapSetInfo> ImportModel(BeatmapSetInfo item, ArchiveReader archive = null, bool batchImport = false, CancellationToken cancellationToken = default)
{
testBeatmapManager.AllowImport.Task.WaitSafely();
return (testBeatmapManager.CurrentImport = base.Import(item, archive, batchImport, cancellationToken));
return (testBeatmapManager.CurrentImport = base.ImportModel(item, archive, batchImport, cancellationToken));
}
}
}

View File

@ -101,7 +101,7 @@ namespace osu.Game.Beatmaps
foreach (BeatmapInfo b in beatmapSet.Beatmaps)
b.BeatmapSet = beatmapSet;
var imported = beatmapImporter.Import(beatmapSet);
var imported = beatmapImporter.ImportModel(beatmapSet);
if (imported == null)
throw new InvalidOperationException("Failed to import new beatmap");
@ -410,7 +410,7 @@ namespace osu.Game.Beatmaps
beatmapImporter.Import(task, batchImport, cancellationToken);
public Live<BeatmapSetInfo>? Import(BeatmapSetInfo item, ArchiveReader? archive = null, CancellationToken cancellationToken = default) =>
beatmapImporter.Import(item, archive, false, cancellationToken);
beatmapImporter.ImportModel(item, archive, false, cancellationToken);
public IEnumerable<string> HandledExtensions => beatmapImporter.HandledExtensions;

View File

@ -236,7 +236,7 @@ namespace osu.Game.Database
return null;
}
var scheduledImport = Task.Factory.StartNew(() => Import(model, archive, batchImport, cancellationToken),
var scheduledImport = Task.Factory.StartNew(() => ImportModel(model, archive, batchImport, cancellationToken),
cancellationToken,
TaskCreationOptions.HideScheduler,
batchImport ? import_scheduler_batch : import_scheduler);
@ -251,7 +251,7 @@ namespace osu.Game.Database
/// <param name="archive">An optional archive to use for model population.</param>
/// <param name="batchImport">If <c>true</c>, imports will be skipped before they begin, given an existing model matches on hash and filenames. Should generally only be used for large batch imports, as it may defy user expectations when updating an existing model.</param>
/// <param name="cancellationToken">An optional cancellation token.</param>
public virtual Live<TModel>? Import(TModel item, ArchiveReader? archive = null, bool batchImport = false, CancellationToken cancellationToken = default) => Realm.Run(realm =>
public virtual Live<TModel>? ImportModel(TModel item, ArchiveReader? archive = null, bool batchImport = false, CancellationToken cancellationToken = default) => Realm.Run(realm =>
{
cancellationToken.ThrowIfCancellationRequested();

View File

@ -265,7 +265,7 @@ namespace osu.Game.Scoring
public Task<IEnumerable<Live<ScoreInfo>>> Import(ProgressNotification notification, params ImportTask[] tasks) => scoreImporter.Import(notification, tasks);
public Live<ScoreInfo> Import(ScoreInfo item, ArchiveReader archive = null, bool batchImport = false, CancellationToken cancellationToken = default) =>
scoreImporter.Import(item, archive, batchImport, cancellationToken);
scoreImporter.ImportModel(item, archive, batchImport, cancellationToken);
#region Implementation of IPresentImports<ScoreInfo>

View File

@ -167,7 +167,7 @@ namespace osu.Game.Skinning
Name = NamingUtils.GetNextBestName(existingSkinNames, $@"{s.Name} (modified)")
};
var result = skinImporter.Import(skinInfo);
var result = skinImporter.ImportModel(skinInfo);
if (result != null)
{