1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-24 22:36:19 -04:00

New: Consider all scene SxxE00 releases Specials as well.

* New: Consider all scene SxxE00 releases Specials as well.

* Cleanup special episode titles and handle E00 specials with existing scenemappings.

* Moved handling of scene mapped E00 to central function.
This commit is contained in:
Taloth
2018-01-04 21:49:16 +01:00
committed by GitHub
parent ad10349878
commit d0e8aef949
9 changed files with 94 additions and 18 deletions
+23 -1
View File
@@ -213,6 +213,16 @@ namespace NzbDrone.Core.Parser
RegexOptions.IgnoreCase | RegexOptions.Compiled)
};
private static readonly Regex[] SpecialEpisodeTitleRegex = new Regex[]
{
new Regex(@"\.S\d+E00\.(?<episodetitle>.+?)(?:\.(?:720p|1080p|HDTV|WEB|WEBRip|WEB-DL)\.|$)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
new Regex(@"\.S\d+\.Special\.(?<episodetitle>.+?)(?:\.(?:720p|1080p|HDTV|WEB|WEBRip|WEB-DL)\.|$)",
RegexOptions.IgnoreCase | RegexOptions.Compiled)
};
private static readonly Regex[] RejectHashedReleasesRegex = new Regex[]
{
// Generic match for md5 and mixed-case hashes.
@@ -456,7 +466,19 @@ namespace NzbDrone.Core.Parser
public static string NormalizeEpisodeTitle(string title)
{
title = SpecialEpisodeWordRegex.Replace(title, string.Empty);
var match = SpecialEpisodeTitleRegex
.Select(v => v.Match(title))
.Where(v => v.Success)
.FirstOrDefault();
if (match != null)
{
title = match.Groups["episodetitle"].Value;
}
// Disabled, Until we run into specific testcases for the removal of these words.
//title = SpecialEpisodeWordRegex.Replace(title, string.Empty);
title = PunctuationRegex.Replace(title, " ");
title = DuplicateSpacesRegex.Replace(title, " ");