handle year in name when searching

This commit is contained in:
Luke Pulverenti
2014-02-13 23:00:13 -05:00
parent 58a46171ab
commit a4b40ad9d9
21 changed files with 2761 additions and 227 deletions

View File

@@ -1,4 +1,5 @@
using MediaBrowser.Common.IO;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO;
using MediaBrowser.Model.Logging;
using System;
using System.IO;
@@ -332,5 +333,34 @@ namespace MediaBrowser.Common.Implementations.IO
return path.TrimEnd(Path.DirectorySeparatorChar);
}
public string SubstitutePath(string path, string from, string to)
{
if (string.IsNullOrWhiteSpace(path))
{
throw new ArgumentNullException("path");
}
if (string.IsNullOrWhiteSpace(from))
{
throw new ArgumentNullException("from");
}
if (string.IsNullOrWhiteSpace(to))
{
throw new ArgumentNullException("to");
}
path = path.Replace(from, to, StringComparison.OrdinalIgnoreCase);
if (to.IndexOf('/') != -1)
{
path = path.Replace('\\', '/');
}
else
{
path = path.Replace('/', '\\');
}
return path;
}
}
}