Change CollectionManager to only store MD5 hashes instead of full BeatmapInfo

This commit is contained in:
Dean Herbert
2022-06-08 18:23:09 +09:00
parent cf438b1a44
commit 42cd7d9e6e
9 changed files with 43 additions and 33 deletions

View File

@ -30,7 +30,22 @@ namespace osu.Game.Overlays.Music
var items = (SearchContainer<RearrangeableListItem<Live<BeatmapSetInfo>>>)ListContainer;
foreach (var item in items.OfType<PlaylistItem>())
item.InSelectedCollection = criteria.Collection?.Beatmaps.Any(b => item.Model.ID == b.BeatmapSet?.ID) ?? true;
{
var beatmapHashes = item.Model.Value.Beatmaps.Select(b => b.MD5Hash);
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;
}