refactor doTheThing
This commit is contained in:
parent
7d7e9bac6c
commit
787721381d
@ -91,9 +91,12 @@ public class ChksumUtils {
|
|||||||
|
|
||||||
public void doTheThing() {
|
public void doTheThing() {
|
||||||
using (var connection = new SqliteConnection("Data Source=" + DatabaseRoot + "chksum.db;Mode=ReadWrite")) {
|
using (var connection = new SqliteConnection("Data Source=" + DatabaseRoot + "chksum.db;Mode=ReadWrite")) {
|
||||||
if (getTotalFileCount() >= 1) {
|
if (getTotalFileCount() < 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
connection.Open();
|
connection.Open();
|
||||||
Dictionary<string, string> fileHashes = CalculateChecksums(indexFiles());
|
Dictionary<string, string> fileHashes = CalculateChecksums(indexFiles());
|
||||||
|
|
||||||
foreach (var file in fileHashes) {
|
foreach (var file in fileHashes) {
|
||||||
string absolutePathToFile = file.Key;
|
string absolutePathToFile = file.Key;
|
||||||
string fileName = Path.GetFileName(absolutePathToFile);
|
string fileName = Path.GetFileName(absolutePathToFile);
|
||||||
@ -115,7 +118,6 @@ public class ChksumUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private bool checkIfFileAlreadyExistsInDatabase(string fileHash, string pathToFile) {
|
private bool checkIfFileAlreadyExistsInDatabase(string fileHash, string pathToFile) {
|
||||||
string filehash = string.Empty;
|
string filehash = string.Empty;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user