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>()) foreach (var item in items.OfType<PlaylistItem>())
{ {
var beatmapHashes = item.Model.Value.Beatmaps.Select(b => b.MD5Hash); if (criteria.Collection == null)
item.InSelectedCollection = true;
bool contained = false; else
foreach (string hash in beatmapHashes)
{ {
if (criteria.Collection?.Beatmaps.Contains(hash) == true) var beatmapHashes = item.Model.Value.Beatmaps.Select(b => b.MD5Hash);
{
contained = true;
break;
}
}
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; items.SearchTerm = criteria.SearchText;