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

@ -245,7 +245,7 @@ namespace osu.Game.Screens.Select.Carousel
TernaryState state;
int countExisting = beatmapSet.Beatmaps.Count(b => collection.Beatmaps.Contains(b));
int countExisting = beatmapSet.Beatmaps.Count(b => collection.Beatmaps.Contains(b.MD5Hash));
if (countExisting == beatmapSet.Beatmaps.Count)
state = TernaryState.True;
@ -261,14 +261,14 @@ namespace osu.Game.Screens.Select.Carousel
switch (s)
{
case TernaryState.True:
if (collection.Beatmaps.Contains(b))
if (collection.Beatmaps.Contains(b.MD5Hash))
continue;
collection.Beatmaps.Add(b);
collection.Beatmaps.Add(b.MD5Hash);
break;
case TernaryState.False:
collection.Beatmaps.Remove(b);
collection.Beatmaps.Remove(b.MD5Hash);
break;
}
}