public void RecalculateChecksum(SyncItem syncItem)
{
string checksum;
try
{
checksum = Checksum(syncItem.LocalPath);
}
catch (IOException)
{
Logger.Error("IOException while reading file checksum: " + syncItem.LocalPath);
return;
}
string localPath = RemoveLocalPrefix(syncItem.LocalPath); // TODO use relative localpath method of SyncItem
string command = @"UPDATE files
SET checksum=@checksum
WHERE localPath=@localPath";
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("checksum", checksum);
parameters.Add("localPath", localPath);
ExecuteSQLAction(command, parameters);
}