Skip to content

Commit

Permalink
refactor(database): store overlay hash
Browse files Browse the repository at this point in the history
  • Loading branch information
DorielRivalet committed Sep 7, 2023
1 parent 77affa8 commit ce9f6a9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions MHFZ_Overlay/Services/DatabaseService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2985,8 +2985,7 @@ public string StoreOverlayHash()
using (var stream = File.OpenRead(exePath))
{
var hash = sha256.ComputeHash(stream);
var hashString = BitConverter.ToString(hash).Replace("-", string.Empty);
overlayHash = hashString;
overlayHash = BitConverter.ToString(hash).Replace("-", string.Empty);

// Store the hash in the "Overlay" table of the SQLite database
using (var conn = new SQLiteConnection(this.dataSource))
Expand All @@ -2999,7 +2998,7 @@ public string StoreOverlayHash()
var sql = "INSERT INTO Overlay (Hash) VALUES (@hash)";
using (var cmd = new SQLiteCommand(sql, conn))
{
cmd.Parameters.AddWithValue("@hash", hashString);
cmd.Parameters.AddWithValue("@hash", overlayHash);
cmd.ExecuteNonQuery();
}

Expand Down

0 comments on commit ce9f6a9

Please sign in to comment.