Remove RealmArchiveModelManager from hierarchy

This commit is contained in:
Dean Herbert
2022-06-16 18:53:13 +09:00
parent 8a5755ca52
commit f3984d98e6
10 changed files with 69 additions and 165 deletions

View File

@ -32,7 +32,7 @@ namespace osu.Game.Beatmaps
/// Handles the storage and retrieval of Beatmaps/WorkingBeatmaps.
/// </summary>
[ExcludeFromDynamicCompile]
public class BeatmapImporter : RealmArchiveModelManager<BeatmapSetInfo>, IDisposable
public class BeatmapImporter : RealmArchiveModelImporter<BeatmapSetInfo>, IDisposable
{
public override IEnumerable<string> HandledExtensions => new[] { ".osz" };
@ -40,7 +40,7 @@ namespace osu.Game.Beatmaps
private readonly BeatmapOnlineLookupQueue? onlineLookupQueue;
public BeatmapImporter(RealmAccess realm, Storage storage, BeatmapOnlineLookupQueue? onlineLookupQueue = null)
public BeatmapImporter(Storage storage, RealmAccess realm, BeatmapOnlineLookupQueue? onlineLookupQueue = null)
: base(storage, realm)
{
this.onlineLookupQueue = onlineLookupQueue;
@ -165,11 +165,6 @@ namespace osu.Game.Beatmaps
existing.DateAdded = DateTimeOffset.UtcNow;
}
public override bool IsAvailableLocally(BeatmapSetInfo model)
{
return Realm.Run(realm => realm.All<BeatmapSetInfo>().Any(s => s.OnlineID == model.OnlineID));
}
public override string HumanisedModelName => "beatmap";
protected override BeatmapSetInfo? CreateModel(ArchiveReader reader)