|
@@ -113,7 +113,7 @@ namespace Emby.Naming.TV
|
|
|
if (expression.DateTimeFormats.Length > 0)
|
|
|
{
|
|
|
if (DateTime.TryParseExact(
|
|
|
- match.Groups[0].Value,
|
|
|
+ match.Groups[0].ValueSpan,
|
|
|
expression.DateTimeFormats,
|
|
|
CultureInfo.InvariantCulture,
|
|
|
DateTimeStyles.None,
|
|
@@ -125,7 +125,7 @@ namespace Emby.Naming.TV
|
|
|
result.Success = true;
|
|
|
}
|
|
|
}
|
|
|
- else if (DateTime.TryParse(match.Groups[0].Value, out date))
|
|
|
+ else if (DateTime.TryParse(match.Groups[0].ValueSpan, out date))
|
|
|
{
|
|
|
result.Year = date.Year;
|
|
|
result.Month = date.Month;
|
|
@@ -138,12 +138,12 @@ namespace Emby.Naming.TV
|
|
|
}
|
|
|
else if (expression.IsNamed)
|
|
|
{
|
|
|
- if (int.TryParse(match.Groups["seasonnumber"].Value, NumberStyles.Integer, CultureInfo.InvariantCulture, out var num))
|
|
|
+ if (int.TryParse(match.Groups["seasonnumber"].ValueSpan, NumberStyles.Integer, CultureInfo.InvariantCulture, out var num))
|
|
|
{
|
|
|
result.SeasonNumber = num;
|
|
|
}
|
|
|
|
|
|
- if (int.TryParse(match.Groups["epnumber"].Value, NumberStyles.Integer, CultureInfo.InvariantCulture, out num))
|
|
|
+ if (int.TryParse(match.Groups["epnumber"].ValueSpan, NumberStyles.Integer, CultureInfo.InvariantCulture, out num))
|
|
|
{
|
|
|
result.EpisodeNumber = num;
|
|
|
}
|
|
@@ -158,7 +158,7 @@ namespace Emby.Naming.TV
|
|
|
if (nextIndex >= name.Length
|
|
|
|| !"0123456789iIpP".Contains(name[nextIndex], StringComparison.Ordinal))
|
|
|
{
|
|
|
- if (int.TryParse(endingNumberGroup.Value, NumberStyles.Integer, CultureInfo.InvariantCulture, out num))
|
|
|
+ if (int.TryParse(endingNumberGroup.ValueSpan, NumberStyles.Integer, CultureInfo.InvariantCulture, out num))
|
|
|
{
|
|
|
result.EndingEpisodeNumber = num;
|
|
|
}
|
|
@@ -170,12 +170,12 @@ namespace Emby.Naming.TV
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (int.TryParse(match.Groups[1].Value, NumberStyles.Integer, CultureInfo.InvariantCulture, out var num))
|
|
|
+ if (int.TryParse(match.Groups[1].ValueSpan, NumberStyles.Integer, CultureInfo.InvariantCulture, out var num))
|
|
|
{
|
|
|
result.SeasonNumber = num;
|
|
|
}
|
|
|
|
|
|
- if (int.TryParse(match.Groups[2].Value, NumberStyles.Integer, CultureInfo.InvariantCulture, out num))
|
|
|
+ if (int.TryParse(match.Groups[2].ValueSpan, NumberStyles.Integer, CultureInfo.InvariantCulture, out num))
|
|
|
{
|
|
|
result.EpisodeNumber = num;
|
|
|
}
|