mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2026-05-01 04:29:34 -05:00
FF-1876: Fixed TV Episode lookup with space between season and episode number
This commit is contained in:
@@ -32,6 +32,23 @@ public class TVEpisodeLookupTests : TestBase
|
||||
Assert.IsFalse(string.IsNullOrWhiteSpace(args.Variables["tvepisode.Overview"] as string));
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void TheBatman_s02space01()
|
||||
{
|
||||
var args = GetNodeParameters("The Batman/Season 2/The Batman s02 e01.mkv");
|
||||
|
||||
var element = new TVEpisodeLookup();
|
||||
|
||||
var result = element.Execute(args);
|
||||
Assert.AreEqual(1, result);
|
||||
|
||||
Assert.AreEqual("The Batman", args.Variables["tvepisode.Title"]);
|
||||
Assert.AreEqual(2, args.Variables["tvepisode.Season"]);
|
||||
Assert.AreEqual(1, args.Variables["tvepisode.Episode"]);
|
||||
Assert.AreEqual("The Cat, the Bat and the Very Ugly", args.Variables["tvepisode.Subtitle"]);
|
||||
Assert.IsFalse(string.IsNullOrWhiteSpace(args.Variables["tvepisode.Overview"] as string));
|
||||
}
|
||||
[TestMethod]
|
||||
public void TheBatman_2x03()
|
||||
{
|
||||
|
||||
@@ -196,7 +196,7 @@ public class TVShowLookup : Node
|
||||
// Replace "1x02" format with "s1e02"
|
||||
text = Regex.Replace(text, @"(?<season>\d+)x(?<episode>\d+)", "s${season}e${episode}", RegexOptions.IgnoreCase);
|
||||
// Replace "s01.02" or "s01.e02" with "s01e02"
|
||||
text = Regex.Replace(text, @"(?<season>s\d+)\.(e)?(?<episode>\d+)", "${season}e${episode}", RegexOptions.IgnoreCase);
|
||||
text = Regex.Replace(text, @"(?<season>s\d+)[\.\s]?(e)?(?<episode>\d+)", "${season}e${episode}", RegexOptions.IgnoreCase);
|
||||
|
||||
// this removes any {tvdb-123456} etc
|
||||
string variableMatch = @"\{[a-zA-Z]+-[0-9]+\}";
|
||||
|
||||
Reference in New Issue
Block a user