Skip to content

Commit

Permalink
Clean up log spamming on start up and importing.
Browse files Browse the repository at this point in the history
Fix case sensitive folder names in scanning throwing a false warning
  • Loading branch information
da3dsoul committed Mar 2, 2017
1 parent 9af1729 commit 87c5d1a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Shoko.Server/Commands/CommandRequest_HashFile.cs
Expand Up @@ -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
{
Expand Down Expand Up @@ -107,7 +107,7 @@ private SVR_VideoLocal_Place ProcessFile_LocalInfo()
Tuple<SVR_ImportFolder, string> 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;
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions Shoko.Server/Importer.cs
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
Expand Up @@ -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('\\');
Expand Down

0 comments on commit 87c5d1a

Please sign in to comment.