1
0
mirror of synced 2024-11-27 16:10:53 +01:00

Prevent duplicate keys in wordlist

This commit is contained in:
asesidaa 2022-09-09 23:21:46 +08:00
parent 1998c2128a
commit 75c98591d8

View File

@ -26,7 +26,8 @@ public class GameDataService : IGameDataService
musicInfo.ThrowIfNull(); musicInfo.ThrowIfNull();
wordList.ThrowIfNull(); wordList.ThrowIfNull();
var dict = wordList.WordListEntries.ToImmutableDictionary(entry => entry.Key); var dict = wordList.WordListEntries.GroupBy(entry => entry.Key)
.ToImmutableDictionary(group => group.Key, group => group.First());
foreach (var music in musicInfo.Items) foreach (var music in musicInfo.Items)
{ {
var songNameKey = $"song_{music.Id}"; var songNameKey = $"song_{music.Id}";