aboutsummaryrefslogtreecommitdiff
path: root/Emby.Naming/TV/SeasonPathParser.cs
diff options
context:
space:
mode:
authorBond_009 <Bond.009@outlook.com>2020-02-08 21:49:28 +0100
committerBond_009 <Bond.009@outlook.com>2020-02-08 21:49:28 +0100
commitf96bc23c4fb958c44c17a8832ec13fad37f48f1c (patch)
treee56d5c35677a6d3890b426d474fe9e3e729d5c7e /Emby.Naming/TV/SeasonPathParser.cs
parent91707f13a877dd4e8b70d0857f0343215be76758 (diff)
parent77428d338db09c4f3df3121281d952851a8a89ec (diff)
Merge branch 'master' into nullable2
Diffstat (limited to 'Emby.Naming/TV/SeasonPathParser.cs')
-rw-r--r--Emby.Naming/TV/SeasonPathParser.cs39
1 files changed, 20 insertions, 19 deletions
diff --git a/Emby.Naming/TV/SeasonPathParser.cs b/Emby.Naming/TV/SeasonPathParser.cs
index e5f90e966..7715a16a4 100644
--- a/Emby.Naming/TV/SeasonPathParser.cs
+++ b/Emby.Naming/TV/SeasonPathParser.cs
@@ -8,9 +8,24 @@ using System.Linq;
namespace Emby.Naming.TV
{
- public class SeasonPathParser
+ public static class SeasonPathParser
{
- public SeasonPathParserResult Parse(string path, bool supportSpecialAliases, bool supportNumericSeasonFolders)
+ /// <summary>
+ /// A season folder must contain one of these somewhere in the name.
+ /// </summary>
+ private static readonly string[] _seasonFolderNames =
+ {
+ "season",
+ "sæson",
+ "temporada",
+ "saison",
+ "staffel",
+ "series",
+ "сезон",
+ "stagione"
+ };
+
+ public static SeasonPathParserResult Parse(string path, bool supportSpecialAliases, bool supportNumericSeasonFolders)
{
var result = new SeasonPathParserResult();
@@ -28,21 +43,6 @@ namespace Emby.Naming.TV
}
/// <summary>
- /// A season folder must contain one of these somewhere in the name.
- /// </summary>
- private static readonly string[] _seasonFolderNames =
- {
- "season",
- "sæson",
- "temporada",
- "saison",
- "staffel",
- "series",
- "сезон",
- "stagione"
- };
-
- /// <summary>
/// Gets the season number from path.
/// </summary>
/// <param name="path">The path.</param>
@@ -150,6 +150,7 @@ namespace Emby.Naming.TV
{
numericStart = i;
}
+
length++;
}
}
@@ -161,11 +162,11 @@ namespace Emby.Naming.TV
}
var currentChar = path[i];
- if (currentChar.Equals('('))
+ if (currentChar == '(')
{
hasOpenParenth = true;
}
- else if (currentChar.Equals(')'))
+ else if (currentChar == ')')
{
hasOpenParenth = false;
}