mirror of https://github.com/ppy/osu
parent
abd72c496b
commit
8696f82627
|
@ -173,7 +173,7 @@ public virtual void Save(BeatmapInfo info, IBeatmap beatmapContent, ISkin? beatm
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="query">The query.</param>
|
/// <param name="query">The query.</param>
|
||||||
/// <returns>Results from the provided query.</returns>
|
/// <returns>Results from the provided query.</returns>
|
||||||
public IEnumerable<BeatmapSetInfo> QueryBeatmapSets(Expression<Func<BeatmapSetInfo, bool>> query) => beatmapModelManager.QueryBeatmapSets(query);
|
public ILive<IEnumerable<BeatmapSetInfo>> QueryBeatmapSets(Expression<Func<BeatmapSetInfo, bool>> query) => beatmapModelManager.QueryBeatmapSets(query).ToLive(contextFactory);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Perform a lookup query on available <see cref="BeatmapSetInfo"/>s.
|
/// Perform a lookup query on available <see cref="BeatmapSetInfo"/>s.
|
||||||
|
|
|
@ -100,7 +100,7 @@ private void load(OsuConfigManager config, SkinManager skinManager, BeatmapManag
|
||||||
if (sets.Count > 0)
|
if (sets.Count > 0)
|
||||||
{
|
{
|
||||||
setInfo = beatmaps.QueryBeatmapSet(s => s.ID == sets[RNG.Next(0, sets.Count - 1)].ID);
|
setInfo = beatmaps.QueryBeatmapSet(s => s.ID == sets[RNG.Next(0, sets.Count - 1)].ID);
|
||||||
initialBeatmap = beatmaps.GetWorkingBeatmap(setInfo.Beatmaps[0]);
|
initialBeatmap = beatmaps.GetWorkingBeatmap(setInfo?.Beatmaps[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ private void load(OsuConfigManager config, SkinManager skinManager, BeatmapManag
|
||||||
// this could happen if a user has nuked their files store. for now, reimport to repair this.
|
// this could happen if a user has nuked their files store. for now, reimport to repair this.
|
||||||
var import = beatmaps.Import(new ZipArchiveReader(game.Resources.GetStream($"Tracks/{BeatmapFile}"), BeatmapFile)).GetResultSafely();
|
var import = beatmaps.Import(new ZipArchiveReader(game.Resources.GetStream($"Tracks/{BeatmapFile}"), BeatmapFile)).GetResultSafely();
|
||||||
|
|
||||||
import.PerformWrite(b =>
|
import?.PerformWrite(b =>
|
||||||
{
|
{
|
||||||
b.Protected = true;
|
b.Protected = true;
|
||||||
beatmaps.Update(b);
|
beatmaps.Update(b);
|
||||||
|
|
Loading…
Reference in New Issue