From 5ffaedc024fe49740182c0e10f7c8eb2d49306e0 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 29 Sep 2019 11:57:46 -0700 Subject: [PATCH] Keep path scanning on individual files, for now --- BurnOutSharp/ProtectionFind.cs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/BurnOutSharp/ProtectionFind.cs b/BurnOutSharp/ProtectionFind.cs index 34e8fe43..b9bb9375 100644 --- a/BurnOutSharp/ProtectionFind.cs +++ b/BurnOutSharp/ProtectionFind.cs @@ -46,10 +46,10 @@ namespace BurnOutSharp // If we have a file if (File.Exists(path)) { - // Try using just the path first to get protection info - string pathProtection = ScanPath(path, false); - if (!string.IsNullOrWhiteSpace(pathProtection)) - protections[path] = pathProtection; + // Try using just the file first to get protection info + string fileProtection = ScanPath(path, false); + if (!string.IsNullOrWhiteSpace(fileProtection)) + protections[path] = fileProtection; // Now check to see if the file contains any additional information string contentProtection = ScanInFile(path)?.Replace("" + (char)0x00, ""); @@ -81,10 +81,20 @@ namespace BurnOutSharp // Get the current file string file = files.ElementAt(i); + // Try using just the file first to get protection info + string fileProtection = ScanPath(file, false); + if (!string.IsNullOrWhiteSpace(fileProtection)) + protections[file] = fileProtection; + // Now check to see if the file contains any additional information string contentProtection = ScanInFile(file)?.Replace("" + (char)0x00, ""); if (!string.IsNullOrWhiteSpace(contentProtection)) - protections[file] = contentProtection; + { + if (protections.ContainsKey(file)) + protections[file] += $", {contentProtection}"; + else + protections[file] = contentProtection; + } // Checkpoint progress?.Report(new FileProtection(file, i / files.Count(), contentProtection));