Skip to content

Commit

Permalink
Fix for #491
Browse files Browse the repository at this point in the history
  • Loading branch information
SirSparkles authored Aug 30, 2018
1 parent 8e0aa36 commit 3777ce6
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions TVRename/TVRename/BullkAddManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,13 @@ private bool HasSeasonFolders(DirectoryInfo di, out DirectoryInfo[] subDirs, out
foreach (DirectoryInfo subDir in subDirs)
{
//TODO - this could make use of the presets to see whether they match

string regex = "^(?<folderName>" + sw + "\\s*)(?<number>\\d+)$";
Match m = Regex.Match(subDir.Name, regex, RegexOptions.IgnoreCase);
if (!m.Success) continue;

//We have a match!
if (m.Groups["folderName"].Length > 1)
{
folderFormat = m.Groups["folderName"] + " " + (m.Groups["number"].ToString().StartsWith("0") ? "{Season:2}" : "{Season}");
}
else
{
folderFormat = m.Groups["folderName"] + (m.Groups["number"].ToString().StartsWith("0") ? "{Season:2}" : "{Season}");
}
folderFormat = m.Groups["folderName"] + (m.Groups["number"].ToString().StartsWith("0") ? "{Season:2}" : "{Season}");

Logger.Info("Assuming {0} contains a show because pattern '{1}' is found in subdirectory {2}",
di.FullName, folderFormat, subDir.FullName);

Expand Down

0 comments on commit 3777ce6

Please sign in to comment.