add debug logging messages

pull/702/head
Luke Pulverenti 12 years ago
parent cbd3de416c
commit afbd4e3b48

@ -1,6 +1,7 @@
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Resolvers; using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Model.Logging;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@ -13,6 +14,8 @@ namespace MediaBrowser.Server.Implementations.Library
/// </summary> /// </summary>
public class CoreResolutionIgnoreRule : IResolverIgnoreRule public class CoreResolutionIgnoreRule : IResolverIgnoreRule
{ {
private readonly ILogger _logger;
/// <summary> /// <summary>
/// Any folder named in this list will be ignored - can be added to at runtime for extensibility /// Any folder named in this list will be ignored - can be added to at runtime for extensibility
/// </summary> /// </summary>
@ -27,6 +30,11 @@ namespace MediaBrowser.Server.Implementations.Library
"extrafanart" "extrafanart"
}; };
public CoreResolutionIgnoreRule(ILogger logger)
{
_logger = logger;
}
/// <summary> /// <summary>
/// Shoulds the ignore. /// Shoulds the ignore.
/// </summary> /// </summary>
@ -51,6 +59,8 @@ namespace MediaBrowser.Server.Implementations.Library
{ {
return false; return false;
} }
_logger.Error("Operating system reports drive is not ready: {0}", args.Path);
} }
return true; return true;

@ -405,6 +405,7 @@ namespace MediaBrowser.Server.Implementations.Library
if (!fileInfo.Exists) if (!fileInfo.Exists)
{ {
_logger.Error("Path in library does not exist or is unavailable: " + path);
return null; return null;
} }
@ -437,8 +438,10 @@ namespace MediaBrowser.Server.Implementations.Library
{ {
var paths = args.FileSystemDictionary.Keys.ToList(); var paths = args.FileSystemDictionary.Keys.ToList();
foreach (var subPath in paths.Where(subPath => paths.Any(i => subPath.StartsWith(i.TrimEnd(System.IO.Path.DirectorySeparatorChar) + System.IO.Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)))) foreach (var subPath in paths
.Where(subPath => !subPath.EndsWith(":\\", StringComparison.OrdinalIgnoreCase) && paths.Any(i => subPath.StartsWith(i.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase))))
{ {
_logger.Info("Ignoring duplicate path: {0}", subPath);
args.FileSystemDictionary.Remove(subPath); args.FileSystemDictionary.Remove(subPath);
} }
} }

Loading…
Cancel
Save