Temporarily disable WorkingBeatmapCache and fix multiple invalid data flows

This commit is contained in:
Dean Herbert
2021-12-22 17:05:00 +09:00
parent 0793b0f0ab
commit 33060990b7
5 changed files with 57 additions and 48 deletions

View File

@ -12,7 +12,6 @@ using osu.Framework.IO.Stores;
using osu.Framework.Lists;
using osu.Framework.Logging;
using osu.Framework.Platform;
using osu.Framework.Statistics;
using osu.Framework.Testing;
using osu.Game.Beatmaps.Formats;
using osu.Game.Database;
@ -86,23 +85,11 @@ namespace osu.Game.Beatmaps
if (beatmapInfo?.BeatmapSet == null)
return DefaultBeatmap;
lock (workingCache)
{
var working = workingCache.FirstOrDefault(w => beatmapInfo.Equals(w.BeatmapInfo));
WorkingBeatmap working = null;
if (working != null)
return working;
working = new BeatmapManagerWorkingBeatmap(beatmapInfo, this);
// TODO: is this still required..?
//beatmapInfo.Metadata ??= beatmapInfo.BeatmapSet.Metadata;
workingCache.Add(working = new BeatmapManagerWorkingBeatmap(beatmapInfo, this));
// best effort; may be higher than expected.
GlobalStatistics.Get<int>(nameof(Beatmaps), $"Cached {nameof(WorkingBeatmap)}s").Value = workingCache.Count();
return working;
}
return working;
}
#region IResourceStorageProvider