From 55402f5c399582d0c11346155b88d431475573c6 Mon Sep 17 00:00:00 2001 From: Al <26797547+Al12rs@users.noreply.github.com> Date: Mon, 24 Jul 2023 16:18:08 +0200 Subject: [PATCH] Only persist Analysis Data if it is actually an archive. (#459) --- src/NexusMods.DataModel/ArchiveAnalyzer.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/NexusMods.DataModel/ArchiveAnalyzer.cs b/src/NexusMods.DataModel/ArchiveAnalyzer.cs index 0941530d38..e759787992 100644 --- a/src/NexusMods.DataModel/ArchiveAnalyzer.cs +++ b/src/NexusMods.DataModel/ArchiveAnalyzer.cs @@ -93,11 +93,14 @@ public async Task AnalyzeFileAsync(AbsolutePath path, Cancellation // Analyze the archive and cache the info var result = await AnalyzeFileInnerAsync(new NativeFileStreamFactory(path), path.FileName, token); - result.EnsurePersisted(_store); - // Save the source of this archive so we can use it later + if (result is AnalyzedArchive archive) - { + { + // Only persist AnalyzedData if it's an archive + result.EnsurePersisted(_store); + + // Save the source of this archive so we can use it later var metaData = FileArchiveMetaData.Create(path, archive); metaData.EnsurePersisted(_store); }