|
|
@ -1,4 +1,4 @@
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Globalization;
|
|
|
|
using System.Globalization;
|
|
|
|
using System.IO;
|
|
|
|
using System.IO;
|
|
|
@ -85,6 +85,8 @@ namespace NzbDrone.Core
|
|
|
|
|
|
|
|
|
|
|
|
private static readonly Regex MultiPartCleanupRegex = new Regex(@"\(\d+\)$", RegexOptions.Compiled);
|
|
|
|
private static readonly Regex MultiPartCleanupRegex = new Regex(@"\(\d+\)$", RegexOptions.Compiled);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static readonly Regex LanguageRegex = new Regex(@"(?:\W|_)(?<italian>ita|italian)|(?<german>german\b)|(?<flemish>flemish)|(?<greek>greek)(?:\W|_)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
|
|
|
|
|
|
|
|
|
|
|
internal static EpisodeParseResult ParsePath(string path)
|
|
|
|
internal static EpisodeParseResult ParsePath(string path)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var fileInfo = new FileInfo(path);
|
|
|
|
var fileInfo = new FileInfo(path);
|
|
|
@ -388,16 +390,6 @@ namespace NzbDrone.Core
|
|
|
|
if (lowerTitle.Contains("spanish"))
|
|
|
|
if (lowerTitle.Contains("spanish"))
|
|
|
|
return LanguageType.Spanish;
|
|
|
|
return LanguageType.Spanish;
|
|
|
|
|
|
|
|
|
|
|
|
if (lowerTitle.Contains("german"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//Make sure it doesn't contain Germany (Since we're not using REGEX for all this)
|
|
|
|
|
|
|
|
if (!lowerTitle.Contains("germany"))
|
|
|
|
|
|
|
|
return LanguageType.German;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (lowerTitle.Contains("italian"))
|
|
|
|
|
|
|
|
return LanguageType.Italian;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (lowerTitle.Contains("danish"))
|
|
|
|
if (lowerTitle.Contains("danish"))
|
|
|
|
return LanguageType.Danish;
|
|
|
|
return LanguageType.Danish;
|
|
|
|
|
|
|
|
|
|
|
@ -440,6 +432,20 @@ namespace NzbDrone.Core
|
|
|
|
if (lowerTitle.Contains("portuguese"))
|
|
|
|
if (lowerTitle.Contains("portuguese"))
|
|
|
|
return LanguageType.Portuguese;
|
|
|
|
return LanguageType.Portuguese;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var match = LanguageRegex.Match(title);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (match.Groups["italian"].Captures.Cast<Capture>().Any())
|
|
|
|
|
|
|
|
return LanguageType.Italian;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (match.Groups["german"].Captures.Cast<Capture>().Any())
|
|
|
|
|
|
|
|
return LanguageType.German;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (match.Groups["flemish"].Captures.Cast<Capture>().Any())
|
|
|
|
|
|
|
|
return LanguageType.Flemish;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (match.Groups["greek"].Captures.Cast<Capture>().Any())
|
|
|
|
|
|
|
|
return LanguageType.Greek;
|
|
|
|
|
|
|
|
|
|
|
|
return LanguageType.English;
|
|
|
|
return LanguageType.English;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|