Update usages of BeatmapModelManager which only require importing to use BeatmapImporter

This commit is contained in:
Dean Herbert
2022-06-16 17:59:07 +09:00
parent 4c372539a1
commit 84dba36cf5
2 changed files with 28 additions and 28 deletions

View File

@ -38,7 +38,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using (var importer = new BeatmapModelManager(realm, storage)) using (var importer = new BeatmapImporter(realm, storage))
using (new RealmRulesetStore(realm, storage)) using (new RealmRulesetStore(realm, storage))
{ {
Live<BeatmapSetInfo>? beatmapSet; Live<BeatmapSetInfo>? beatmapSet;
@ -82,7 +82,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using (var importer = new BeatmapModelManager(realm, storage)) using (var importer = new BeatmapImporter(realm, storage))
using (new RealmRulesetStore(realm, storage)) using (new RealmRulesetStore(realm, storage))
{ {
Live<BeatmapSetInfo>? beatmapSet; Live<BeatmapSetInfo>? beatmapSet;
@ -141,7 +141,7 @@ namespace osu.Game.Tests.Database
{ {
BeatmapSetInfo? detachedSet = null; BeatmapSetInfo? detachedSet = null;
using (var importer = new BeatmapModelManager(realm, storage)) using (var importer = new BeatmapImporter(realm, storage))
using (new RealmRulesetStore(realm, storage)) using (new RealmRulesetStore(realm, storage))
{ {
Task.Run(async () => Task.Run(async () =>
@ -170,7 +170,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using (var importer = new BeatmapModelManager(realm, storage)) using (var importer = new BeatmapImporter(realm, storage))
using (new RealmRulesetStore(realm, storage)) using (new RealmRulesetStore(realm, storage))
{ {
Live<BeatmapSetInfo>? imported; Live<BeatmapSetInfo>? imported;
@ -202,7 +202,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
await LoadOszIntoStore(importer, realm.Realm); await LoadOszIntoStore(importer, realm.Realm);
@ -214,7 +214,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
var imported = await LoadOszIntoStore(importer, realm.Realm); var imported = await LoadOszIntoStore(importer, realm.Realm);
@ -232,7 +232,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
var imported = await LoadOszIntoStore(importer, realm.Realm); var imported = await LoadOszIntoStore(importer, realm.Realm);
@ -246,7 +246,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
string? tempPath = TestResources.GetTestBeatmapForImport(); string? tempPath = TestResources.GetTestBeatmapForImport();
@ -276,7 +276,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
var imported = await LoadOszIntoStore(importer, realm.Realm); var imported = await LoadOszIntoStore(importer, realm.Realm);
@ -296,7 +296,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
string? temp = TestResources.GetTestBeatmapForImport(); string? temp = TestResources.GetTestBeatmapForImport();
@ -345,7 +345,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
string? temp = TestResources.GetTestBeatmapForImport(); string? temp = TestResources.GetTestBeatmapForImport();
@ -396,7 +396,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
string? temp = TestResources.GetTestBeatmapForImport(); string? temp = TestResources.GetTestBeatmapForImport();
@ -444,7 +444,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
string? temp = TestResources.GetTestBeatmapForImport(); string? temp = TestResources.GetTestBeatmapForImport();
@ -492,7 +492,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
var imported = await LoadOszIntoStore(importer, realm.Realm); var imported = await LoadOszIntoStore(importer, realm.Realm);
@ -527,7 +527,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
var progressNotification = new ImportProgressNotification(); var progressNotification = new ImportProgressNotification();
@ -565,7 +565,7 @@ namespace osu.Game.Tests.Database
Interlocked.Increment(ref loggedExceptionCount); Interlocked.Increment(ref loggedExceptionCount);
}; };
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
var imported = await LoadOszIntoStore(importer, realm.Realm); var imported = await LoadOszIntoStore(importer, realm.Realm);
@ -617,7 +617,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
var imported = await LoadOszIntoStore(importer, realm.Realm, batchImport: true); var imported = await LoadOszIntoStore(importer, realm.Realm, batchImport: true);
@ -644,7 +644,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realmFactory, storage) => RunTestWithRealmAsync(async (realmFactory, storage) =>
{ {
using var importer = new BeatmapModelManager(realmFactory, storage); using var importer = new BeatmapImporter(realmFactory, storage);
using var store = new RealmRulesetStore(realmFactory, storage); using var store = new RealmRulesetStore(realmFactory, storage);
var imported = await LoadOszIntoStore(importer, realmFactory.Realm); var imported = await LoadOszIntoStore(importer, realmFactory.Realm);
@ -676,7 +676,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
var imported = await LoadOszIntoStore(importer, realm.Realm); var imported = await LoadOszIntoStore(importer, realm.Realm);
@ -703,7 +703,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
var imported = await LoadOszIntoStore(importer, realm.Realm); var imported = await LoadOszIntoStore(importer, realm.Realm);
@ -729,7 +729,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealm((realm, storage) => RunTestWithRealm((realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
var metadata = new BeatmapMetadata var metadata = new BeatmapMetadata
@ -777,7 +777,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
string? temp = TestResources.GetTestBeatmapForImport(); string? temp = TestResources.GetTestBeatmapForImport();
@ -794,7 +794,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
string? temp = TestResources.GetTestBeatmapForImport(); string? temp = TestResources.GetTestBeatmapForImport();
@ -830,7 +830,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
string? temp = TestResources.GetTestBeatmapForImport(); string? temp = TestResources.GetTestBeatmapForImport();
@ -872,7 +872,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
string? temp = TestResources.GetTestBeatmapForImport(); string? temp = TestResources.GetTestBeatmapForImport();
@ -923,7 +923,7 @@ namespace osu.Game.Tests.Database
{ {
RunTestWithRealmAsync(async (realm, storage) => RunTestWithRealmAsync(async (realm, storage) =>
{ {
using var importer = new BeatmapModelManager(realm, storage); using var importer = new BeatmapImporter(realm, storage);
using var store = new RealmRulesetStore(realm, storage); using var store = new RealmRulesetStore(realm, storage);
string? temp = TestResources.GetTestBeatmapForImport(); string? temp = TestResources.GetTestBeatmapForImport();

View File

@ -32,7 +32,7 @@ namespace osu.Game.Beatmaps
/// Handles the storage and retrieval of Beatmaps/WorkingBeatmaps. /// Handles the storage and retrieval of Beatmaps/WorkingBeatmaps.
/// </summary> /// </summary>
[ExcludeFromDynamicCompile] [ExcludeFromDynamicCompile]
public abstract class BeatmapImporter : RealmArchiveModelManager<BeatmapSetInfo>, IDisposable public class BeatmapImporter : RealmArchiveModelManager<BeatmapSetInfo>, IDisposable
{ {
public override IEnumerable<string> HandledExtensions => new[] { ".osz" }; public override IEnumerable<string> HandledExtensions => new[] { ".osz" };
@ -40,7 +40,7 @@ namespace osu.Game.Beatmaps
private readonly BeatmapOnlineLookupQueue? onlineLookupQueue; private readonly BeatmapOnlineLookupQueue? onlineLookupQueue;
protected BeatmapImporter(RealmAccess realm, Storage storage, BeatmapOnlineLookupQueue? onlineLookupQueue = null) public BeatmapImporter(RealmAccess realm, Storage storage, BeatmapOnlineLookupQueue? onlineLookupQueue = null)
: base(storage, realm) : base(storage, realm)
{ {
this.onlineLookupQueue = onlineLookupQueue; this.onlineLookupQueue = onlineLookupQueue;