mirror of
https://github.com/ppy/osu
synced 2025-01-04 21:30:08 +00:00
Handle beatmapset removal in DownloadTrackingComposite
This commit is contained in:
parent
99046f16e8
commit
a289cb7c6a
@ -51,6 +51,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
};
|
};
|
||||||
|
|
||||||
beatmaps.ItemAdded += setAdded;
|
beatmaps.ItemAdded += setAdded;
|
||||||
|
beatmaps.ItemRemoved += setRemoved;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Disposal
|
#region Disposal
|
||||||
@ -120,12 +121,16 @@ namespace osu.Game.Overlays.Direct
|
|||||||
Schedule(() => attachDownload(null));
|
Schedule(() => attachDownload(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setAdded(BeatmapSetInfo s, bool existing, bool silent)
|
private void setAdded(BeatmapSetInfo s, bool existing, bool silent) => setDownloadState(s, DownloadState.Downloaded);
|
||||||
|
|
||||||
|
private void setRemoved(BeatmapSetInfo s) => setDownloadState(s, DownloadState.NotDownloaded);
|
||||||
|
|
||||||
|
private void setDownloadState(BeatmapSetInfo s, DownloadState state)
|
||||||
{
|
{
|
||||||
if (s.OnlineBeatmapSetID != BeatmapSet.Value?.OnlineBeatmapSetID)
|
if (s.OnlineBeatmapSetID != BeatmapSet.Value?.OnlineBeatmapSetID)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Schedule(() => State.Value = DownloadState.LocallyAvailable);
|
Schedule(() => State.Value = state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user