mirror of
https://github.com/osukey/osukey.git
synced 2025-06-16 16:57:56 +09:00
Update remaining cases of clashing variable name in realm.Run(realm..
This commit is contained in:
parent
3e5c9e8436
commit
e23b10e6a5
@ -29,7 +29,7 @@ namespace osu.Game.Benchmarks
|
|||||||
|
|
||||||
realm = new RealmAccess(storage, "client");
|
realm = new RealmAccess(storage, "client");
|
||||||
|
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
realm.Write(c => c.Add(TestResources.CreateTestBeatmapSetInfo(rulesets: new[] { new OsuRuleset().RulesetInfo })));
|
realm.Write(c => c.Add(TestResources.CreateTestBeatmapSetInfo(rulesets: new[] { new OsuRuleset().RulesetInfo })));
|
||||||
});
|
});
|
||||||
@ -41,9 +41,9 @@ namespace osu.Game.Benchmarks
|
|||||||
[Benchmark]
|
[Benchmark]
|
||||||
public void BenchmarkDirectPropertyRead()
|
public void BenchmarkDirectPropertyRead()
|
||||||
{
|
{
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
var beatmapSet = realm.All<BeatmapSetInfo>().First();
|
var beatmapSet = r.All<BeatmapSetInfo>().First();
|
||||||
|
|
||||||
for (int i = 0; i < ReadsPerFetch; i++)
|
for (int i = 0; i < ReadsPerFetch; i++)
|
||||||
{
|
{
|
||||||
@ -119,9 +119,9 @@ namespace osu.Game.Benchmarks
|
|||||||
[Benchmark]
|
[Benchmark]
|
||||||
public void BenchmarkDetachedPropertyRead()
|
public void BenchmarkDetachedPropertyRead()
|
||||||
{
|
{
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
var beatmapSet = realm.All<BeatmapSetInfo>().First().Detach();
|
var beatmapSet = r.All<BeatmapSetInfo>().First().Detach();
|
||||||
|
|
||||||
for (int i = 0; i < ReadsPerFetch; i++)
|
for (int i = 0; i < ReadsPerFetch; i++)
|
||||||
{
|
{
|
||||||
|
@ -76,9 +76,9 @@ namespace osu.Game.Tests.Database
|
|||||||
|
|
||||||
private int queryCount(GlobalAction? match = null)
|
private int queryCount(GlobalAction? match = null)
|
||||||
{
|
{
|
||||||
return realm.Run(realm =>
|
return realm.Run(r =>
|
||||||
{
|
{
|
||||||
var results = realm.All<RealmKeyBinding>();
|
var results = r.All<RealmKeyBinding>();
|
||||||
if (match.HasValue)
|
if (match.HasValue)
|
||||||
results = results.Where(k => k.ActionInt == (int)match.Value);
|
results = results.Where(k => k.ActionInt == (int)match.Value);
|
||||||
return results.Count();
|
return results.Count();
|
||||||
|
@ -42,9 +42,9 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
var beatmapInfo = realm.All<BeatmapInfo>()
|
var beatmapInfo = r.All<BeatmapInfo>()
|
||||||
.Filter($"{nameof(BeatmapInfo.Ruleset)}.{nameof(RulesetInfo.OnlineID)} = $0", 0)
|
.Filter($"{nameof(BeatmapInfo.Ruleset)}.{nameof(RulesetInfo.OnlineID)} = $0", 0)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
@ -122,10 +122,10 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
[SetUp]
|
[SetUp]
|
||||||
public void Setup() => Schedule(() =>
|
public void Setup() => Schedule(() =>
|
||||||
{
|
{
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
// Due to soft deletions, we can re-use deleted scores between test runs
|
// Due to soft deletions, we can re-use deleted scores between test runs
|
||||||
scoreManager.Undelete(realm.All<ScoreInfo>().Where(s => s.DeletePending).ToList());
|
scoreManager.Undelete(r.All<ScoreInfo>().Where(s => s.DeletePending).ToList());
|
||||||
});
|
});
|
||||||
|
|
||||||
leaderboard.Scores = null;
|
leaderboard.Scores = null;
|
||||||
|
@ -119,12 +119,12 @@ namespace osu.Game.Beatmaps
|
|||||||
/// <param name="beatmapInfo">The beatmap difficulty to hide.</param>
|
/// <param name="beatmapInfo">The beatmap difficulty to hide.</param>
|
||||||
public void Hide(BeatmapInfo beatmapInfo)
|
public void Hide(BeatmapInfo beatmapInfo)
|
||||||
{
|
{
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
using (var transaction = realm.BeginWrite())
|
using (var transaction = r.BeginWrite())
|
||||||
{
|
{
|
||||||
if (!beatmapInfo.IsManaged)
|
if (!beatmapInfo.IsManaged)
|
||||||
beatmapInfo = realm.Find<BeatmapInfo>(beatmapInfo.ID);
|
beatmapInfo = r.Find<BeatmapInfo>(beatmapInfo.ID);
|
||||||
|
|
||||||
beatmapInfo.Hidden = true;
|
beatmapInfo.Hidden = true;
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
@ -138,12 +138,12 @@ namespace osu.Game.Beatmaps
|
|||||||
/// <param name="beatmapInfo">The beatmap difficulty to restore.</param>
|
/// <param name="beatmapInfo">The beatmap difficulty to restore.</param>
|
||||||
public void Restore(BeatmapInfo beatmapInfo)
|
public void Restore(BeatmapInfo beatmapInfo)
|
||||||
{
|
{
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
using (var transaction = realm.BeginWrite())
|
using (var transaction = r.BeginWrite())
|
||||||
{
|
{
|
||||||
if (!beatmapInfo.IsManaged)
|
if (!beatmapInfo.IsManaged)
|
||||||
beatmapInfo = realm.Find<BeatmapInfo>(beatmapInfo.ID);
|
beatmapInfo = r.Find<BeatmapInfo>(beatmapInfo.ID);
|
||||||
|
|
||||||
beatmapInfo.Hidden = false;
|
beatmapInfo.Hidden = false;
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
@ -153,11 +153,11 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public void RestoreAll()
|
public void RestoreAll()
|
||||||
{
|
{
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
using (var transaction = realm.BeginWrite())
|
using (var transaction = r.BeginWrite())
|
||||||
{
|
{
|
||||||
foreach (var beatmap in realm.All<BeatmapInfo>().Where(b => b.Hidden))
|
foreach (var beatmap in r.All<BeatmapInfo>().Where(b => b.Hidden))
|
||||||
beatmap.Hidden = false;
|
beatmap.Hidden = false;
|
||||||
|
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
@ -171,10 +171,10 @@ namespace osu.Game.Beatmaps
|
|||||||
/// <returns>A list of available <see cref="BeatmapSetInfo"/>.</returns>
|
/// <returns>A list of available <see cref="BeatmapSetInfo"/>.</returns>
|
||||||
public List<BeatmapSetInfo> GetAllUsableBeatmapSets()
|
public List<BeatmapSetInfo> GetAllUsableBeatmapSets()
|
||||||
{
|
{
|
||||||
return realm.Run(realm =>
|
return realm.Run(r =>
|
||||||
{
|
{
|
||||||
realm.Refresh();
|
r.Refresh();
|
||||||
return realm.All<BeatmapSetInfo>().Where(b => !b.DeletePending).Detach();
|
return r.All<BeatmapSetInfo>().Where(b => !b.DeletePending).Detach();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,9 +240,9 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public void Delete(Expression<Func<BeatmapSetInfo, bool>>? filter = null, bool silent = false)
|
public void Delete(Expression<Func<BeatmapSetInfo, bool>>? filter = null, bool silent = false)
|
||||||
{
|
{
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
var items = realm.All<BeatmapSetInfo>().Where(s => !s.DeletePending && !s.Protected);
|
var items = r.All<BeatmapSetInfo>().Where(s => !s.DeletePending && !s.Protected);
|
||||||
|
|
||||||
if (filter != null)
|
if (filter != null)
|
||||||
items = items.Where(filter);
|
items = items.Where(filter);
|
||||||
@ -253,7 +253,7 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public void UndeleteAll()
|
public void UndeleteAll()
|
||||||
{
|
{
|
||||||
realm.Run(realm => beatmapModelManager.Undelete(realm.All<BeatmapSetInfo>().Where(s => s.DeletePending).ToList()));
|
realm.Run(r => beatmapModelManager.Undelete(r.All<BeatmapSetInfo>().Where(s => s.DeletePending).ToList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Undelete(List<BeatmapSetInfo> items, bool silent = false)
|
public void Undelete(List<BeatmapSetInfo> items, bool silent = false)
|
||||||
@ -312,9 +312,9 @@ namespace osu.Game.Beatmaps
|
|||||||
// If we seem to be missing files, now is a good time to re-fetch.
|
// If we seem to be missing files, now is a good time to re-fetch.
|
||||||
if (importedBeatmap?.BeatmapSet?.Files.Count == 0)
|
if (importedBeatmap?.BeatmapSet?.Files.Count == 0)
|
||||||
{
|
{
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
var refetch = realm.Find<BeatmapInfo>(importedBeatmap.ID)?.Detach();
|
var refetch = r.Find<BeatmapInfo>(importedBeatmap.ID)?.Detach();
|
||||||
|
|
||||||
if (refetch != null)
|
if (refetch != null)
|
||||||
importedBeatmap = refetch;
|
importedBeatmap = refetch;
|
||||||
|
@ -158,11 +158,11 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
int count = existingBeatmapSets.Count();
|
int count = existingBeatmapSets.Count();
|
||||||
|
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
log($"Found {count} beatmaps in EF");
|
log($"Found {count} beatmaps in EF");
|
||||||
|
|
||||||
var transaction = realm.BeginWrite();
|
var transaction = r.BeginWrite();
|
||||||
int written = 0;
|
int written = 0;
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -172,7 +172,7 @@ namespace osu.Game.Database
|
|||||||
if (++written % 1000 == 0)
|
if (++written % 1000 == 0)
|
||||||
{
|
{
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
transaction = realm.BeginWrite();
|
transaction = r.BeginWrite();
|
||||||
log($"Migrated {written}/{count} beatmaps...");
|
log($"Migrated {written}/{count} beatmaps...");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,11 +186,11 @@ namespace osu.Game.Database
|
|||||||
Protected = beatmapSet.Protected,
|
Protected = beatmapSet.Protected,
|
||||||
};
|
};
|
||||||
|
|
||||||
migrateFiles(beatmapSet, realm, realmBeatmapSet);
|
migrateFiles(beatmapSet, r, realmBeatmapSet);
|
||||||
|
|
||||||
foreach (var beatmap in beatmapSet.Beatmaps)
|
foreach (var beatmap in beatmapSet.Beatmaps)
|
||||||
{
|
{
|
||||||
var ruleset = realm.Find<RulesetInfo>(beatmap.RulesetInfo.ShortName);
|
var ruleset = r.Find<RulesetInfo>(beatmap.RulesetInfo.ShortName);
|
||||||
var metadata = getBestMetadata(beatmap.Metadata, beatmapSet.Metadata);
|
var metadata = getBestMetadata(beatmap.Metadata, beatmapSet.Metadata);
|
||||||
|
|
||||||
var realmBeatmap = new BeatmapInfo(ruleset, new BeatmapDifficulty(beatmap.BaseDifficulty), metadata)
|
var realmBeatmap = new BeatmapInfo(ruleset, new BeatmapDifficulty(beatmap.BaseDifficulty), metadata)
|
||||||
@ -225,7 +225,7 @@ namespace osu.Game.Database
|
|||||||
realmBeatmapSet.Beatmaps.Add(realmBeatmap);
|
realmBeatmapSet.Beatmaps.Add(realmBeatmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
realm.Add(realmBeatmapSet);
|
r.Add(realmBeatmapSet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
@ -280,11 +280,11 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
int count = existingScores.Count();
|
int count = existingScores.Count();
|
||||||
|
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
log($"Found {count} scores in EF");
|
log($"Found {count} scores in EF");
|
||||||
|
|
||||||
var transaction = realm.BeginWrite();
|
var transaction = r.BeginWrite();
|
||||||
int written = 0;
|
int written = 0;
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -294,12 +294,12 @@ namespace osu.Game.Database
|
|||||||
if (++written % 1000 == 0)
|
if (++written % 1000 == 0)
|
||||||
{
|
{
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
transaction = realm.BeginWrite();
|
transaction = r.BeginWrite();
|
||||||
log($"Migrated {written}/{count} scores...");
|
log($"Migrated {written}/{count} scores...");
|
||||||
}
|
}
|
||||||
|
|
||||||
var beatmap = realm.All<BeatmapInfo>().First(b => b.Hash == score.BeatmapInfo.Hash);
|
var beatmap = r.All<BeatmapInfo>().First(b => b.Hash == score.BeatmapInfo.Hash);
|
||||||
var ruleset = realm.Find<RulesetInfo>(score.Ruleset.ShortName);
|
var ruleset = r.Find<RulesetInfo>(score.Ruleset.ShortName);
|
||||||
var user = new RealmUser
|
var user = new RealmUser
|
||||||
{
|
{
|
||||||
OnlineID = score.User.OnlineID,
|
OnlineID = score.User.OnlineID,
|
||||||
@ -329,9 +329,9 @@ namespace osu.Game.Database
|
|||||||
APIMods = score.APIMods,
|
APIMods = score.APIMods,
|
||||||
};
|
};
|
||||||
|
|
||||||
migrateFiles(score, realm, realmScore);
|
migrateFiles(score, r, realmScore);
|
||||||
|
|
||||||
realm.Add(realmScore);
|
r.Add(realmScore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
@ -369,13 +369,13 @@ namespace osu.Game.Database
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
using (var transaction = realm.BeginWrite())
|
using (var transaction = r.BeginWrite())
|
||||||
{
|
{
|
||||||
// only migrate data if the realm database is empty.
|
// only migrate data if the realm database is empty.
|
||||||
// note that this cannot be written as: `realm.All<SkinInfo>().All(s => s.Protected)`, because realm does not support `.All()`.
|
// note that this cannot be written as: `r.All<SkinInfo>().All(s => s.Protected)`, because realm does not support `.All()`.
|
||||||
if (!realm.All<SkinInfo>().Any(s => !s.Protected))
|
if (!r.All<SkinInfo>().Any(s => !s.Protected))
|
||||||
{
|
{
|
||||||
log($"Migrating {existingSkins.Count} skins");
|
log($"Migrating {existingSkins.Count} skins");
|
||||||
|
|
||||||
@ -390,9 +390,9 @@ namespace osu.Game.Database
|
|||||||
InstantiationInfo = skin.InstantiationInfo,
|
InstantiationInfo = skin.InstantiationInfo,
|
||||||
};
|
};
|
||||||
|
|
||||||
migrateFiles(skin, realm, realmSkin);
|
migrateFiles(skin, r, realmSkin);
|
||||||
|
|
||||||
realm.Add(realmSkin);
|
r.Add(realmSkin);
|
||||||
|
|
||||||
if (skin.ID == userSkinInt)
|
if (skin.ID == userSkinInt)
|
||||||
userSkinChoice.Value = realmSkin.ID.ToString();
|
userSkinChoice.Value = realmSkin.ID.ToString();
|
||||||
@ -428,12 +428,12 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
log("Beginning settings migration to realm");
|
log("Beginning settings migration to realm");
|
||||||
|
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
using (var transaction = realm.BeginWrite())
|
using (var transaction = r.BeginWrite())
|
||||||
{
|
{
|
||||||
// only migrate data if the realm database is empty.
|
// only migrate data if the realm database is empty.
|
||||||
if (!realm.All<RealmRulesetSetting>().Any())
|
if (!r.All<RealmRulesetSetting>().Any())
|
||||||
{
|
{
|
||||||
log($"Migrating {existingSettings.Count} settings");
|
log($"Migrating {existingSettings.Count} settings");
|
||||||
|
|
||||||
@ -447,7 +447,7 @@ namespace osu.Game.Database
|
|||||||
if (string.IsNullOrEmpty(shortName))
|
if (string.IsNullOrEmpty(shortName))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
realm.Add(new RealmRulesetSetting
|
r.Add(new RealmRulesetSetting
|
||||||
{
|
{
|
||||||
Key = dkb.Key,
|
Key = dkb.Key,
|
||||||
Value = dkb.StringValue,
|
Value = dkb.StringValue,
|
||||||
|
@ -51,10 +51,7 @@ namespace osu.Game.Database
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
realm.Run(realm =>
|
realm.Run(r => perform(retrieveFromID(r, ID)));
|
||||||
{
|
|
||||||
perform(retrieveFromID(realm, ID));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -66,9 +63,9 @@ namespace osu.Game.Database
|
|||||||
if (!IsManaged)
|
if (!IsManaged)
|
||||||
return perform(data);
|
return perform(data);
|
||||||
|
|
||||||
return realm.Run(realm =>
|
return realm.Run(r =>
|
||||||
{
|
{
|
||||||
var returnData = perform(retrieveFromID(realm, ID));
|
var returnData = perform(retrieveFromID(r, ID));
|
||||||
|
|
||||||
if (returnData is RealmObjectBase realmObject && realmObject.IsManaged)
|
if (returnData is RealmObjectBase realmObject && realmObject.IsManaged)
|
||||||
throw new InvalidOperationException(@$"Managed realm objects should not exit the scope of {nameof(PerformRead)}.");
|
throw new InvalidOperationException(@$"Managed realm objects should not exit the scope of {nameof(PerformRead)}.");
|
||||||
|
@ -56,21 +56,21 @@ namespace osu.Game.Input
|
|||||||
/// <param name="rulesets">The rulesets to populate defaults from.</param>
|
/// <param name="rulesets">The rulesets to populate defaults from.</param>
|
||||||
public void Register(KeyBindingContainer container, IEnumerable<RulesetInfo> rulesets)
|
public void Register(KeyBindingContainer container, IEnumerable<RulesetInfo> rulesets)
|
||||||
{
|
{
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
using (var transaction = realm.BeginWrite())
|
using (var transaction = r.BeginWrite())
|
||||||
{
|
{
|
||||||
// intentionally flattened to a list rather than querying against the IQueryable, as nullable fields being queried against aren't indexed.
|
// intentionally flattened to a list rather than querying against the IQueryable, as nullable fields being queried against aren't indexed.
|
||||||
// this is much faster as a result.
|
// this is much faster as a result.
|
||||||
var existingBindings = realm.All<RealmKeyBinding>().ToList();
|
var existingBindings = r.All<RealmKeyBinding>().ToList();
|
||||||
|
|
||||||
insertDefaults(realm, existingBindings, container.DefaultKeyBindings);
|
insertDefaults(r, existingBindings, container.DefaultKeyBindings);
|
||||||
|
|
||||||
foreach (var ruleset in rulesets)
|
foreach (var ruleset in rulesets)
|
||||||
{
|
{
|
||||||
var instance = ruleset.CreateInstance();
|
var instance = ruleset.CreateInstance();
|
||||||
foreach (int variant in instance.AvailableVariants)
|
foreach (int variant in instance.AvailableVariants)
|
||||||
insertDefaults(realm, existingBindings, instance.GetDefaultKeyBindings(variant), ruleset.ShortName, variant);
|
insertDefaults(r, existingBindings, instance.GetDefaultKeyBindings(variant), ruleset.ShortName, variant);
|
||||||
}
|
}
|
||||||
|
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
|
@ -386,10 +386,10 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
|
|
||||||
private void updateStoreFromButton(KeyButton button)
|
private void updateStoreFromButton(KeyButton button)
|
||||||
{
|
{
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
var binding = realm.Find<RealmKeyBinding>(((IHasGuidPrimaryKey)button.KeyBinding).ID);
|
var binding = r.Find<RealmKeyBinding>(((IHasGuidPrimaryKey)button.KeyBinding).ID);
|
||||||
realm.Write(() => binding.KeyCombinationString = button.KeyBinding.KeyCombinationString);
|
r.Write(() => binding.KeyCombinationString = button.KeyBinding.KeyCombinationString);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ namespace osu.Game.Scoring
|
|||||||
/// <returns>The first result for the provided query, or null if no results were found.</returns>
|
/// <returns>The first result for the provided query, or null if no results were found.</returns>
|
||||||
public ScoreInfo Query(Expression<Func<ScoreInfo, bool>> query)
|
public ScoreInfo Query(Expression<Func<ScoreInfo, bool>> query)
|
||||||
{
|
{
|
||||||
return realm.Run(realm => realm.All<ScoreInfo>().FirstOrDefault(query)?.Detach());
|
return realm.Run(r => r.All<ScoreInfo>().FirstOrDefault(query)?.Detach());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -254,9 +254,9 @@ namespace osu.Game.Scoring
|
|||||||
|
|
||||||
public void Delete([CanBeNull] Expression<Func<ScoreInfo, bool>> filter = null, bool silent = false)
|
public void Delete([CanBeNull] Expression<Func<ScoreInfo, bool>> filter = null, bool silent = false)
|
||||||
{
|
{
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
var items = realm.All<ScoreInfo>()
|
var items = r.All<ScoreInfo>()
|
||||||
.Where(s => !s.DeletePending);
|
.Where(s => !s.DeletePending);
|
||||||
|
|
||||||
if (filter != null)
|
if (filter != null)
|
||||||
|
@ -179,7 +179,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
if (!loadedTestBeatmaps)
|
if (!loadedTestBeatmaps)
|
||||||
{
|
{
|
||||||
realm.Run(realm => loadBeatmapSets(getBeatmapSets(realm)));
|
realm.Run(r => loadBeatmapSets(getBeatmapSets(r)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,9 +150,9 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
|
|
||||||
if (Scope == BeatmapLeaderboardScope.Local)
|
if (Scope == BeatmapLeaderboardScope.Local)
|
||||||
{
|
{
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
var scores = realm.All<ScoreInfo>()
|
var scores = r.All<ScoreInfo>()
|
||||||
.AsEnumerable()
|
.AsEnumerable()
|
||||||
// TODO: update to use a realm filter directly (or at least figure out the beatmap part to reduce scope).
|
// TODO: update to use a realm filter directly (or at least figure out the beatmap part to reduce scope).
|
||||||
.Where(s => !s.DeletePending && s.BeatmapInfo.ID == fetchBeatmapInfo.ID && s.Ruleset.OnlineID == ruleset.Value.ID);
|
.Where(s => !s.DeletePending && s.BeatmapInfo.ID == fetchBeatmapInfo.ID && s.Ruleset.OnlineID == ruleset.Value.ID);
|
||||||
|
@ -289,9 +289,9 @@ namespace osu.Game.Skinning
|
|||||||
|
|
||||||
public void Delete([CanBeNull] Expression<Func<SkinInfo, bool>> filter = null, bool silent = false)
|
public void Delete([CanBeNull] Expression<Func<SkinInfo, bool>> filter = null, bool silent = false)
|
||||||
{
|
{
|
||||||
realm.Run(realm =>
|
realm.Run(r =>
|
||||||
{
|
{
|
||||||
var items = realm.All<SkinInfo>()
|
var items = r.All<SkinInfo>()
|
||||||
.Where(s => !s.Protected && !s.DeletePending);
|
.Where(s => !s.Protected && !s.DeletePending);
|
||||||
if (filter != null)
|
if (filter != null)
|
||||||
items = items.Where(filter);
|
items = items.Where(filter);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user