Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions TelegramSearchBot.UpdateBuilder/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ static List<UpdateCatalogEntry> PruneCatalogEntries(
})
.ToList();

var tempManifest = new UpdateManifest
var manifest = new UpdateManifest
{
TargetVersion = toVersion,
MinSourceVersion = fromVersion,
Expand All @@ -255,24 +255,9 @@ static List<UpdateCatalogEntry> PruneCatalogEntries(
CreatedAt = DateTime.UtcNow
};

var tempBytes = CreatePackage(tempManifest, files);
var finalChecksum = ComputeSha512(tempBytes);

var finalManifest = new UpdateManifest
{
TargetVersion = toVersion,
MinSourceVersion = fromVersion,
MaxSourceVersion = isCumulative ? null : fromVersion,
IsAnchor = isAnchor,
IsCumulative = isCumulative,
ChainDepth = chainDepth,
Files = manifestFiles,
Checksum = finalChecksum,
CreatedAt = DateTime.UtcNow
};

var finalBytes = CreatePackage(finalManifest, files);
return (finalBytes, finalChecksum);
var packageBytes = CreatePackage(manifest, files);
var packageChecksum = ComputeSha512(packageBytes);
return (packageBytes, packageChecksum);
}

static byte[] CreatePackage(UpdateManifest manifest, IReadOnlyList<UpdateFileContent> files)
Expand Down
Loading