From 87c5d1ad127ce1eb5d96305db59a3522a4ea73a1 Mon Sep 17 00:00:00 2001 From: da3dsoul Date: Thu, 2 Mar 2017 08:18:02 -0500 Subject: [PATCH] Clean up log spamming on start up and importing. Fix case sensitive folder names in scanning throwing a false warning --- Shoko.Server/Commands/CommandRequest_HashFile.cs | 5 +++-- Shoko.Server/Importer.cs | 6 +++--- .../Repositories/Cached/VideoLocal_PlaceRepository.cs | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Shoko.Server/Commands/CommandRequest_HashFile.cs b/Shoko.Server/Commands/CommandRequest_HashFile.cs index 376c2bff3..71446dd68 100644 --- a/Shoko.Server/Commands/CommandRequest_HashFile.cs +++ b/Shoko.Server/Commands/CommandRequest_HashFile.cs @@ -65,7 +65,7 @@ public CommandRequest_HashFile(string filename, bool force) public override void ProcessCommand() { - logger.Info("Hashing File: {0}", FileName); + logger.Trace("Checking File For Hashes: {0}", FileName); try { @@ -107,7 +107,7 @@ private SVR_VideoLocal_Place ProcessFile_LocalInfo() Tuple tup = VideoLocal_PlaceRepository.GetFromFullPath(FileName); if (tup == null) { - logger.Error($"Unable to locate file {FileName} inside the import folders"); + logger.Error($"Unable to locate Import Folder for {FileName}"); return null; } SVR_ImportFolder folder = tup.Item1; @@ -245,6 +245,7 @@ private SVR_VideoLocal_Place ProcessFile_LocalInfo() // hash the file if (string.IsNullOrEmpty(vlocal.Hash) || ForceHash) { + logger.Info("Hashing File: {0}", FileName); ShokoService.CmdProcessorHasher.QueueState = PrettyDescriptionHashing; DateTime start = DateTime.Now; logger.Trace("Calculating ED2K hashes for: {0}", FileName); diff --git a/Shoko.Server/Importer.cs b/Shoko.Server/Importer.cs index 3dc3a6684..9698aad71 100644 --- a/Shoko.Server/Importer.cs +++ b/Shoko.Server/Importer.cs @@ -273,7 +273,7 @@ public static void RunImport_ScanFolder(int importFolderID) } filesFound++; - logger.Info("Processing File {0}/{1} --- {2}", i, fileList.Count, fileName); + logger.Trace("Processing File {0}/{1} --- {2}", i, fileList.Count, fileName); if (!FileHashHelper.IsVideo(fileName)) continue; @@ -313,7 +313,7 @@ public static void RunImport_DropFolders() { i++; filesFound++; - logger.Info("Processing File {0}/{1} --- {2}", i, fileList.Count, fileName); + logger.Trace("Processing File {0}/{1} --- {2}", i, fileList.Count, fileName); if (!FileHashHelper.IsVideo(fileName)) continue; @@ -423,7 +423,7 @@ public static void RunImport_ImportFolderNewFiles(SVR_ImportFolder fldr) { i++; filesFound++; - logger.Info("Processing File {0}/{1} --- {2}", i, fileList.Count, fileName); + logger.Trace("Processing File {0}/{1} --- {2}", i, fileList.Count, fileName); if (!FileHashHelper.IsVideo(fileName)) continue; diff --git a/Shoko.Server/Repositories/Cached/VideoLocal_PlaceRepository.cs b/Shoko.Server/Repositories/Cached/VideoLocal_PlaceRepository.cs index 4730393e4..4f4c50110 100644 --- a/Shoko.Server/Repositories/Cached/VideoLocal_PlaceRepository.cs +++ b/Shoko.Server/Repositories/Cached/VideoLocal_PlaceRepository.cs @@ -81,7 +81,7 @@ public override void Delete(SVR_VideoLocal_Place obj) importLocationFull = importLocationFull + "\\"; importLocation = importLocation.TrimEnd('\\'); - if (fullPath.StartsWith(importLocationFull)) + if (fullPath.StartsWith(importLocationFull, StringComparison.InvariantCultureIgnoreCase)) { string filePath = fullPath.Replace(importLocation, string.Empty); filePath = filePath.TrimStart('\\');