Merge remote-tracking branch 'origin/master' into quality

This commit is contained in:
Mark McDowall 2012-10-14 23:16:00 -07:00
commit c5252ca22d
5 changed files with 89 additions and 20 deletions

View file

@ -83,6 +83,8 @@ namespace NzbDrone.Core
RegexOptions.IgnoreCase | RegexOptions.Compiled),
};
private static readonly Regex MultiPartCleanupRegex = new Regex(@"\(\d+\)$", RegexOptions.Compiled);
internal static EpisodeParseResult ParsePath(string path)
{
var fileInfo = new FileInfo(path);
@ -501,5 +503,11 @@ namespace NzbDrone.Core
return header;
}
internal static string CleanupEpisodeTitle(string title)
{
//this will remove (1),(2) from the end of multi part episodes.
return MultiPartCleanupRegex.Replace(title, string.Empty).Trim();
}
}
}