1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-28 23:32:59 +08:00

Fix filter failure when no collection is selected

This commit is contained in:
Dean Herbert 2022-06-08 19:30:18 +09:00
parent 6aa84425a2
commit c22bffaa01

View File

@ -31,20 +31,25 @@ namespace osu.Game.Overlays.Music
foreach (var item in items.OfType<PlaylistItem>())
{
var beatmapHashes = item.Model.Value.Beatmaps.Select(b => b.MD5Hash);
bool contained = false;
foreach (string hash in beatmapHashes)
if (criteria.Collection == null)
item.InSelectedCollection = true;
else
{
if (criteria.Collection?.Beatmaps.Contains(hash) == true)
{
contained = true;
break;
}
}
var beatmapHashes = item.Model.Value.Beatmaps.Select(b => b.MD5Hash);
item.InSelectedCollection = contained;
bool contained = false;
foreach (string hash in beatmapHashes)
{
if (criteria.Collection?.Beatmaps.Contains(hash) == true)
{
contained = true;
break;
}
}
item.InSelectedCollection = contained;
}
}
items.SearchTerm = criteria.SearchText;