Fixed: Removal of common suffixes such as [ettv] while parsing.

Fixes #874
pull/2/head
Taloth Saldono 9 years ago
parent e8d6d62fba
commit a06a3fa5d6

@ -111,6 +111,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Series Title Season 01 Episode 05 720p", "Series Title", 1, 5)]
//[TestCase("Off the Air - 101 - Animals (460p.x264.vorbis-2.0) [449].mkv", "Off the Air", 1, 1)]
[TestCase("The Young And the Restless - S42 E10713 - 2015-07-20.mp4", "The Young And the Restless", 42, 10713)]
[TestCase("quantico.103.hdtv-lol[ettv].mp4", "quantico", 1, 3)]
//[TestCase("", "", 0, 0)]
public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber)
{

@ -203,6 +203,9 @@ namespace NzbDrone.Core.Parser
private static readonly Regex CleanReleaseGroupRegex = new Regex(@"^(.*?[-._ ](S\d+E\d+)[-._ ])|-(RP|1|NZBGeek|sample)$",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex CleanTorrentSuffixRegex = new Regex(@"\[(?:ettv|rartv|rarbg|cttv)\]$",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex ReleaseGroupRegex = new Regex(@"-(?<releasegroup>[a-z0-9]+)\b(?<!WEB-DL|480p|720p|1080p)",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
@ -270,9 +273,13 @@ namespace NzbDrone.Core.Parser
var simpleTitle = SimpleTitleRegex.Replace(title, string.Empty);
simpleTitle = RemoveFileExtension(simpleTitle);
// TODO: Quick fix stripping [url] - prefixes.
simpleTitle = WebsitePrefixRegex.Replace(simpleTitle, string.Empty);
simpleTitle = CleanTorrentSuffixRegex.Replace(simpleTitle, string.Empty);
var airDateMatch = AirDateRegex.Match(simpleTitle);
if (airDateMatch.Success)
{

Loading…
Cancel
Save