Browse Source

Revert "add debug logs for other video folder scanning (#1369)"

This reverts commit 5e573461f3.
pull/1371/head
Jason Dove 3 years ago
parent
commit
22a13cb1b3
  1. 26
      ErsatzTV.Scanner/Core/Metadata/OtherVideoFolderScanner.cs

26
ErsatzTV.Scanner/Core/Metadata/OtherVideoFolderScanner.cs

@ -70,8 +70,6 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
{ {
try try
{ {
_logger.LogDebug("Starting to scan other videos library");
decimal progressSpread = progressMax - progressMin; decimal progressSpread = progressMax - progressMin;
var foldersCompleted = 0; var foldersCompleted = 0;
@ -81,7 +79,6 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
if (ShouldIncludeFolder(libraryPath.Path) && allFolders.Add(libraryPath.Path)) if (ShouldIncludeFolder(libraryPath.Path) && allFolders.Add(libraryPath.Path))
{ {
_logger.LogDebug("Will scan library path {Path}", libraryPath.Path);
folderQueue.Enqueue(libraryPath.Path); folderQueue.Enqueue(libraryPath.Path);
} }
@ -90,11 +87,9 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
.Filter(allFolders.Add) .Filter(allFolders.Add)
.OrderBy(identity)) .OrderBy(identity))
{ {
_logger.LogDebug("Will scan subdirectory {Folder}", folder);
folderQueue.Enqueue(folder); folderQueue.Enqueue(folder);
} }
_logger.LogDebug("Found {Count} folders to scan", folderQueue.Count);
while (folderQueue.Count > 0) while (folderQueue.Count > 0)
{ {
if (cancellationToken.IsCancellationRequested) if (cancellationToken.IsCancellationRequested)
@ -113,7 +108,6 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
cancellationToken); cancellationToken);
string otherVideoFolder = folderQueue.Dequeue(); string otherVideoFolder = folderQueue.Dequeue();
_logger.LogDebug("Scanning folder {Folder}", otherVideoFolder);
foldersCompleted++; foldersCompleted++;
var filesForEtag = _localFileSystem.ListFiles(otherVideoFolder).ToList(); var filesForEtag = _localFileSystem.ListFiles(otherVideoFolder).ToList();
@ -128,7 +122,6 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
.Filter(allFolders.Add) .Filter(allFolders.Add)
.OrderBy(identity)) .OrderBy(identity))
{ {
_logger.LogDebug("Will scan subdirectory {Subdirectory}", subdirectory);
folderQueue.Enqueue(subdirectory); folderQueue.Enqueue(subdirectory);
} }
@ -138,23 +131,9 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
.HeadOrNone(); .HeadOrNone();
// skip folder if etag matches // skip folder if etag matches
string knownEtag = await knownFolder.Map(f => f.Etag ?? string.Empty).IfNoneAsync(string.Empty); if (!allFiles.Any() || await knownFolder.Map(f => f.Etag ?? string.Empty).IfNoneAsync(string.Empty) ==
if (!allFiles.Any() || knownEtag == etag) etag)
{
if (allFiles.Count == 0)
{
_logger.LogDebug("Skipping folder {Folder} with no files", otherVideoFolder);
}
else
{ {
_logger.LogDebug(
"Skipping folder {Folder} with file count {FileCount} and new etag {Etag} vs last etag {KnownEtag}",
otherVideoFolder,
allFiles.Count,
etag,
knownEtag);
}
continue; continue;
} }
@ -199,7 +178,6 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
if (!hasErrors) if (!hasErrors)
{ {
await _libraryRepository.SetEtag(libraryPath, knownFolder, otherVideoFolder, etag); await _libraryRepository.SetEtag(libraryPath, knownFolder, otherVideoFolder, etag);
_logger.LogDebug("Done scanning folder {Folder}", otherVideoFolder);
} }
} }

Loading…
Cancel
Save