Some minor code cleanups

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-09-11 14:20:12 -04:00
parent 016590529f
commit 670a53258e
80 changed files with 318 additions and 1120 deletions

View File

@@ -10,8 +10,8 @@ namespace MediaBrowser.Controller.IO
{
public class DirectoryWatchers
{
private List<FileSystemWatcher> FileSystemWatchers = new List<FileSystemWatcher>();
private Timer updateTimer = null;
private readonly List<FileSystemWatcher> FileSystemWatchers = new List<FileSystemWatcher>();
private Timer updateTimer;
private List<string> affectedPaths = new List<string>();
private const int TimerDelayInSeconds = 5;
@@ -107,10 +107,8 @@ namespace MediaBrowser.Controller.IO
{
return Kernel.Instance.ReloadRoot();
}
else
{
return Task.WhenAll(itemsToRefresh.Select(i => Kernel.Instance.ReloadItem(i)));
}
return Task.WhenAll(itemsToRefresh.Select(i => Kernel.Instance.ReloadItem(i)));
}
private BaseItem GetAffectedBaseItem(string path)

View File

@@ -149,7 +149,7 @@ namespace MediaBrowser.Controller.IO
private static extern bool FindClose(IntPtr hFindFile);
private const char SpaceChar = ' ';
private static char[] InvalidFileNameChars = Path.GetInvalidFileNameChars();
private static readonly char[] InvalidFileNameChars = Path.GetInvalidFileNameChars();
/// <summary>
/// Takes a filename and removes invalid characters