Add support for non numeric episodes

This commit is contained in:
kaso17
2017-06-25 18:25:16 +02:00
parent 22cf450d07
commit 3f2d6f0cee
2 changed files with 11 additions and 3 deletions

View File

@@ -498,7 +498,7 @@ namespace Jackett.Controllers
queryStr = queryStr.Remove(seasonMatch.Index, seasonMatch.Length);
}
var episodeMatch = Regex.Match(queryStr, @"E(\d{2,4})");
var episodeMatch = Regex.Match(queryStr, @"E(\d{2,4}[A-Za-z]?)");
if (episodeMatch.Success)
{
stringQuery.Episode = episodeMatch.Groups[1].Value;

View File

@@ -202,8 +202,16 @@ namespace Jackett.Models
else if (string.IsNullOrEmpty(Episode))
episodeString = string.Format("S{0:00}", Season);
else
episodeString = string.Format("S{0:00}E{1:00}", Season, ParseUtil.CoerceInt(Episode));
{
try
{
episodeString = string.Format("S{0:00}E{1:00}", Season, ParseUtil.CoerceInt(Episode));
} catch (FormatException) // e.g. seaching for S01E01A
{
episodeString = string.Format("S{0:00}E{1}", Season, Episode);
}
}
return episodeString;
}