You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: FolderSync/Program.cs
+46-29Lines changed: 46 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -88,36 +88,53 @@ private static void Sync()
88
88
backupFileList.Add(backupProps);
89
89
}
90
90
91
-
foreach(varfileinsourceFileList)
91
+
foreach(varfileinsourceFileList)
92
92
{
93
-
varmatchingBackupByFile=backupFileList.FindAll(backup =>backup.RelativeFilePath==file.RelativeFilePath);// the problem here is if there are multiple occurrences of the same file
94
-
varmatchingBackupByMD5=backupFileList.FindAll(backup =>backup.md5Code==file.md5Code);// the problem here is if there are multiple occurrences of the same md5
95
-
96
-
// if (backupDict.ContainsKey(kvp.Key) && IsSameMD5(backupDict[kvp.Key], sourceDict[kvp.Key])) // nothing to do here, both files are the same
97
-
// continue;
98
-
// else if (!backupDict.ContainsKey(kvp.Key) && !backupDict.ContainsValue(kvp.Value)) // the original file has no backup, it will be created here
// else if (!backupDict.ContainsKey(kvp.Key) && backupDict.ContainsValue(kvp.Value)) // the original file was moved or renamed
115
-
// {
116
-
// // check if it was renamed
117
-
// string originalPath = RemoveRoot(Path.GetDirectoryName(Path.Combine(sourceFolder, kvp.Key)), ref sourceFolder); // why am i not getting back the stripped path?
if(matchingBackupByFile.Count==1&&matchingBackupByMD5.Count==1)// File should be the same here, DOESN'T WORK IF FILE HAS A DIFFERENT NAME BUT THE SAME HASH
0 commit comments