mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Maintain download progress between switching result views.
- Check for existing download requests on creating DirectPanel - Actually remove downloaded beatmap from results
This commit is contained in:
@ -47,9 +47,22 @@ namespace osu.Game.Overlays
|
||||
set
|
||||
{
|
||||
if (beatmapSets?.Equals(value) ?? false) return;
|
||||
|
||||
beatmapSets = value;
|
||||
|
||||
recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value);
|
||||
if (beatmapSets == null) return;
|
||||
|
||||
var artists = new List<string>();
|
||||
var songs = new List<string>();
|
||||
var tags = new List<string>();
|
||||
foreach (var s in beatmapSets)
|
||||
{
|
||||
artists.Add(s.Metadata.Artist);
|
||||
songs.Add(s.Metadata.Title);
|
||||
tags.AddRange(s.Metadata.Tags.Split(' '));
|
||||
}
|
||||
|
||||
ResultAmounts = new ResultCounts(distinctCount(artists), distinctCount(songs), distinctCount(tags));
|
||||
}
|
||||
}
|
||||
|
||||
@ -159,6 +172,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
// if a new map was imported, we should remove it from search results (download completed etc.)
|
||||
panels?.FirstOrDefault(p => p.SetInfo.OnlineBeatmapSetID == set.OnlineBeatmapSetID)?.FadeOut(400).Expire();
|
||||
BeatmapSets = BeatmapSets.Where(b => b.OnlineBeatmapSetID != set.OnlineBeatmapSetID);
|
||||
}
|
||||
|
||||
private void updateResultCounts()
|
||||
@ -244,19 +258,7 @@ namespace osu.Game.Overlays
|
||||
Select(response => response.ToBeatmapSet(rulesets)).
|
||||
Where(b => (beatmaps.QueryBeatmapSet(q => q.OnlineBeatmapSetID == b.OnlineBeatmapSetID) == null));
|
||||
|
||||
if (BeatmapSets == null) return;
|
||||
|
||||
var artists = new List<string>();
|
||||
var songs = new List<string>();
|
||||
var tags = new List<string>();
|
||||
foreach (var s in BeatmapSets)
|
||||
{
|
||||
artists.Add(s.Metadata.Artist);
|
||||
songs.Add(s.Metadata.Title);
|
||||
tags.AddRange(s.Metadata.Tags.Split(' '));
|
||||
}
|
||||
|
||||
ResultAmounts = new ResultCounts(distinctCount(artists), distinctCount(songs), distinctCount(tags));
|
||||
recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value);
|
||||
};
|
||||
|
||||
api.Queue(getSetsRequest);
|
||||
|
Reference in New Issue
Block a user