Add flow for bypassing local cache lookups when refreshing beatmap metadata

This commit is contained in:
Dean Herbert
2022-07-28 16:18:30 +09:00
parent 17a3fd30fb
commit c35da62224
8 changed files with 22 additions and 23 deletions

View File

@ -48,15 +48,15 @@ namespace osu.Game.Beatmaps
prepareLocalCache();
}
public void Update(BeatmapSetInfo beatmapSet)
public void Update(BeatmapSetInfo beatmapSet, bool forceOnlineFetch)
{
foreach (var b in beatmapSet.Beatmaps)
lookup(beatmapSet, b);
lookup(beatmapSet, b, forceOnlineFetch);
}
private void lookup(BeatmapSetInfo set, BeatmapInfo beatmapInfo)
private void lookup(BeatmapSetInfo set, BeatmapInfo beatmapInfo, bool forceOnlineFetch)
{
if (checkLocalCache(set, beatmapInfo))
if (!forceOnlineFetch && checkLocalCache(set, beatmapInfo))
return;
if (api?.State.Value != APIState.Online)