diff --git a/.gitignore b/.gitignore index ef8150c0..20d4f315 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ bin/ obj/ # Test results -TestResults/ \ No newline at end of file +TestResults/ diff --git a/DiscordChatExporter.Core/Discord/Dump/DataDump.cs b/DiscordChatExporter.Core/Discord/Dump/DataDump.cs index be3deb1c..10a4832c 100644 --- a/DiscordChatExporter.Core/Discord/Dump/DataDump.cs +++ b/DiscordChatExporter.Core/Discord/Dump/DataDump.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO.Compression; +using System.Linq; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -42,7 +43,13 @@ public partial class DataDump { using var archive = ZipFile.OpenRead(zipFilePath); - var entry = archive.GetEntry("messages/index.json"); + // Try to find the index file with case-insensitive search + // Discord changed the structure from "messages/index.json" to "Messages/index.json" + // https://github.com/Tyrrrz/DiscordChatExporter/issues/1458 + var entry = archive.Entries.FirstOrDefault(e => + e.FullName.Equals("messages/index.json", StringComparison.OrdinalIgnoreCase) + ); + if (entry is null) { throw new InvalidOperationException(