mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Merge pull request #15734 from peppy/realm-beatmap-file-relation
Add helper property to access a realm beatmap's beatmap file
This commit is contained in:
@ -74,6 +74,24 @@ namespace osu.Game.Tests.Database
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestAccessFileAfterImport()
|
||||||
|
{
|
||||||
|
RunTestWithRealmAsync(async (realmFactory, storage) =>
|
||||||
|
{
|
||||||
|
using var importer = new BeatmapImporter(realmFactory, storage);
|
||||||
|
using var store = new RealmRulesetStore(realmFactory, storage);
|
||||||
|
|
||||||
|
var imported = await LoadOszIntoStore(importer, realmFactory.Context);
|
||||||
|
|
||||||
|
var beatmap = imported.Beatmaps.First();
|
||||||
|
var file = beatmap.File;
|
||||||
|
|
||||||
|
Assert.NotNull(file);
|
||||||
|
Assert.AreEqual(beatmap.Hash, file!.File.Hash);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestImportThenDelete()
|
public void TestImportThenDelete()
|
||||||
{
|
{
|
||||||
|
@ -33,10 +33,10 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Version history:
|
/// Version history:
|
||||||
/// 6 First tracked version (~20211018)
|
/// 6 ~2021-10-18 First tracked version.
|
||||||
/// 7 Changed OnlineID fields to non-nullable to add indexing support (20211018)
|
/// 7 2021-10-18 Changed OnlineID fields to non-nullable to add indexing support.
|
||||||
/// 8 Rebind scroll adjust keys to not have control modifier (20211029)
|
/// 8 2021-10-29 Rebind scroll adjust keys to not have control modifier.
|
||||||
/// 9 Converted BeatmapMetadata.Author from string to RealmUser (20211104)
|
/// 9 2021-11-04 Converted BeatmapMetadata.Author from string to RealmUser.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const int schema_version = 9;
|
private const int schema_version = 9;
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
@ -35,6 +36,9 @@ namespace osu.Game.Models
|
|||||||
|
|
||||||
public RealmBeatmapSet? BeatmapSet { get; set; }
|
public RealmBeatmapSet? BeatmapSet { get; set; }
|
||||||
|
|
||||||
|
[Ignored]
|
||||||
|
public RealmNamedFileUsage? File => BeatmapSet?.Files.First(f => f.File.Hash == Hash);
|
||||||
|
|
||||||
public BeatmapSetOnlineStatus Status
|
public BeatmapSetOnlineStatus Status
|
||||||
{
|
{
|
||||||
get => (BeatmapSetOnlineStatus)StatusInt;
|
get => (BeatmapSetOnlineStatus)StatusInt;
|
||||||
|
Reference in New Issue
Block a user