case insensitive match for unmapped folders.

This commit is contained in:
Keivan Beigi 2013-08-20 12:28:46 -07:00
commit c13195046d
6 changed files with 44 additions and 40 deletions

View file

@ -1,4 +1,5 @@
using System.IO;
using System;
using System.IO;
using NzbDrone.Common.EnsureThat;
using NzbDrone.Common.EnvironmentInfo;
@ -35,6 +36,14 @@ namespace NzbDrone.Common
}
public static bool PathEquals(this string firstPath, string secondPath)
{
Ensure.That(() => firstPath).IsValidPath();
Ensure.That(() => secondPath).IsValidPath();
return String.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath(), StringComparison.InvariantCultureIgnoreCase);
}
public static bool ContainsInvalidPathChars(this string text)
{
return text.IndexOfAny(Path.GetInvalidPathChars()) >= 0;