Skip to content

Commit

Permalink
Only persist Analysis Data if it is actually an archive. (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
Al12rs authored Jul 24, 2023
1 parent af68fb8 commit 55402f5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/NexusMods.DataModel/ArchiveAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,14 @@ public async Task<AnalyzedFile> 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);
}
Expand Down

0 comments on commit 55402f5

Please sign in to comment.