diff --git a/TwitchDownloaderCore/TwitchHelper.cs b/TwitchDownloaderCore/TwitchHelper.cs index 2ecc18bf..36c02415 100644 --- a/TwitchDownloaderCore/TwitchHelper.cs +++ b/TwitchDownloaderCore/TwitchHelper.cs @@ -355,7 +355,7 @@ private static async Task> GetStvEmotesMetadata(int stre public static async Task> GetThirdPartyEmotes(List comments, int streamerId, string cacheFolder, ITaskLogger logger, EmbeddedData embeddedData = null, bool bttv = true, bool ffz = true, bool stv = true, bool allowUnlistedEmotes = true, bool offline = false, CancellationToken cancellationToken = default) { List returnList = new List(); - List alreadyAdded = new List(); + HashSet alreadyAdded = new HashSet(); // No 3rd party emotes are wanted if (!bttv && !ffz && !stv) @@ -459,7 +459,7 @@ public static async Task> GetThirdPartyEmotes(List co return returnList; static async Task FetchEmoteImages(IReadOnlyCollection comments, IEnumerable emoteResponse, ICollection returnList, - ICollection alreadyAdded, DirectoryInfo cacheFolder, ITaskLogger logger, CancellationToken cancellationToken) + ISet alreadyAdded, DirectoryInfo cacheFolder, ITaskLogger logger, CancellationToken cancellationToken) { if (!cacheFolder.Exists) cacheFolder = CreateDirectory(cacheFolder.FullName); @@ -500,8 +500,8 @@ where comments.Any(comment => Regex.IsMatch(comment.message.body, pattern)) public static async Task> GetEmotes(List comments, string cacheFolder, ITaskLogger logger, EmbeddedData embeddedData = null, bool offline = false, CancellationToken cancellationToken = default) { List returnList = new List(); - List alreadyAdded = new List(); - List failedEmotes = new List(); + HashSet alreadyAdded = new HashSet(); + HashSet failedEmotes = new HashSet(); DirectoryInfo emoteFolder = new DirectoryInfo(Path.Combine(cacheFolder, "emotes")); if (!emoteFolder.Exists) @@ -633,7 +633,7 @@ public static async Task> GetEmotes(List comments, st public static async Task> GetChatBadges(List comments, int streamerId, string cacheFolder, ITaskLogger logger, EmbeddedData embeddedData = null, bool offline = false, CancellationToken cancellationToken = default) { List returnList = new List(); - List alreadyAdded = new List(); + HashSet alreadyAdded = new HashSet(); // Load our embedded data from file if (embeddedData?.twitchBadges != null) @@ -781,7 +781,7 @@ public static async Task> GetEmojis(string cacheFol public static async Task> GetBits(List comments, string cacheFolder, string channelId, ITaskLogger logger, EmbeddedData embeddedData = null, bool offline = false, CancellationToken cancellationToken = default) { List returnList = new List(); - List alreadyAdded = new List(); + HashSet alreadyAdded = new HashSet(); // Load our embedded data from file if (embeddedData?.twitchBits != null)