case insensitive match for unmapped folders.

This commit is contained in:
Keivan Beigi
2013-08-20 12:28:46 -07:00
parent 1c62782fcd
commit c13195046d
6 changed files with 44 additions and 40 deletions
@@ -73,11 +73,11 @@ namespace NzbDrone.Core.RootFolders
if (!_diskProvider.FolderExists(rootFolder.Path))
throw new DirectoryNotFoundException("Can't add root directory that doesn't exist.");
if (all.Exists(r => DiskProvider.PathEquals(r.Path, rootFolder.Path)))
if (all.Exists(r => r.Path.PathEquals(rootFolder.Path)))
throw new InvalidOperationException("Recent directory already exists.");
if (!String.IsNullOrWhiteSpace(_configService.DownloadedEpisodesFolder) &&
DiskProvider.PathEquals(_configService.DownloadedEpisodesFolder, rootFolder.Path))
_configService.DownloadedEpisodesFolder.PathEquals(rootFolder.Path))
throw new InvalidOperationException("Drone Factory folder cannot be used.");
_rootFolderRepository.Insert(rootFolder);
@@ -109,10 +109,10 @@ namespace NzbDrone.Core.RootFolders
foreach (string seriesFolder in _diskProvider.GetDirectories(path))
{
if (!series.Any(s => s.Path == seriesFolder))
if (!series.Any(s => s.Path.PathEquals(seriesFolder)))
{
var di = new DirectoryInfo(seriesFolder.Normalize());
results.Add(new UnmappedFolder{ Name = di.Name, Path = di.FullName });
results.Add(new UnmappedFolder { Name = di.Name, Path = di.FullName });
}
}