aboutsummaryrefslogtreecommitdiff
path: root/Emby.Naming/TV/EpisodePathParser.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/EpisodePathParser.cs
parent91707f13a877dd4e8b70d0857f0343215be76758 (diff)
parent77428d338db09c4f3df3121281d952851a8a89ec (diff)
Merge branch 'master' into nullable2
Diffstat (limited to 'Emby.Naming/TV/EpisodePathParser.cs')
-rw-r--r--Emby.Naming/TV/EpisodePathParser.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Emby.Naming/TV/EpisodePathParser.cs b/Emby.Naming/TV/EpisodePathParser.cs
index 6b557d2e1..b97b3137b 100644
--- a/Emby.Naming/TV/EpisodePathParser.cs
+++ b/Emby.Naming/TV/EpisodePathParser.cs
@@ -1,5 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
+#nullable enable
using System;
using System.Collections.Generic;
@@ -28,7 +29,7 @@ namespace Emby.Naming.TV
path += ".mp4";
}
- EpisodePathParserResult result = null;
+ EpisodePathParserResult? result = null;
foreach (var expression in _options.EpisodeExpressions)
{
@@ -136,7 +137,7 @@ namespace Emby.Naming.TV
// It avoids erroneous parsing of something like "series-s09e14-1080p.mkv" as a multi-episode from E14 to E108
int nextIndex = endingNumberGroup.Index + endingNumberGroup.Length;
if (nextIndex >= name.Length
- || "0123456789iIpP".IndexOf(name[nextIndex]) == -1)
+ || !"0123456789iIpP".Contains(name[nextIndex], StringComparison.Ordinal))
{
if (int.TryParse(endingNumberGroup.Value, NumberStyles.Integer, CultureInfo.InvariantCulture, out num))
{