From bf485f6f2c678694ebb48ed2b10c09aab612acd4 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 3 Mar 2017 20:57:05 -0800 Subject: [PATCH] Log number of files found when getting video/non-video files --- src/NzbDrone.Core/MediaFiles/DiskScanService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs index e769e38ca..2f6ba4b25 100644 --- a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs +++ b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs @@ -133,11 +133,12 @@ namespace NzbDrone.Core.MediaFiles _logger.Debug("Scanning '{0}' for video files", path); var searchOption = allDirectories ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly; - var filesOnDisk = _diskProvider.GetFiles(path, searchOption); + var filesOnDisk = _diskProvider.GetFiles(path, searchOption).ToList(); var mediaFileList = filesOnDisk.Where(file => MediaFileExtensions.Extensions.Contains(Path.GetExtension(file).ToLower())) .ToList(); + _logger.Trace("{0} files were found in {1}", filesOnDisk.Count, path); _logger.Debug("{0} video files were found in {1}", mediaFileList.Count, path); return mediaFileList.ToArray(); } @@ -147,11 +148,12 @@ namespace NzbDrone.Core.MediaFiles _logger.Debug("Scanning '{0}' for non-video files", path); var searchOption = allDirectories ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly; - var filesOnDisk = _diskProvider.GetFiles(path, searchOption); + var filesOnDisk = _diskProvider.GetFiles(path, searchOption).ToList(); var mediaFileList = filesOnDisk.Where(file => !MediaFileExtensions.Extensions.Contains(Path.GetExtension(file).ToLower())) .ToList(); + _logger.Trace("{0} files were found in {1}", filesOnDisk.Count, path); _logger.Debug("{0} non-video files were found in {1}", mediaFileList.Count, path); return mediaFileList.ToArray(); }