aboutsummaryrefslogtreecommitdiff
path: root/Emby.Naming/TV/EpisodeResolver.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Naming/TV/EpisodeResolver.cs')
-rw-r--r--Emby.Naming/TV/EpisodeResolver.cs20
1 files changed, 6 insertions, 14 deletions
diff --git a/Emby.Naming/TV/EpisodeResolver.cs b/Emby.Naming/TV/EpisodeResolver.cs
index 5e115fc75d..57659ee131 100644
--- a/Emby.Naming/TV/EpisodeResolver.cs
+++ b/Emby.Naming/TV/EpisodeResolver.cs
@@ -1,5 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
+#nullable enable
using System;
using System.IO;
@@ -18,7 +19,7 @@ namespace Emby.Naming.TV
_options = options;
}
- public EpisodeInfo Resolve(
+ public EpisodeInfo? Resolve(
string path,
bool isDirectory,
bool? isNamed = null,
@@ -26,14 +27,9 @@ namespace Emby.Naming.TV
bool? supportsAbsoluteNumbers = null,
bool fillExtendedInfo = true)
{
- if (string.IsNullOrEmpty(path))
- {
- throw new ArgumentNullException(nameof(path));
- }
-
bool isStub = false;
- string container = null;
- string stubType = null;
+ string? container = null;
+ string? stubType = null;
if (!isDirectory)
{
@@ -41,17 +37,13 @@ namespace Emby.Naming.TV
// Check supported extensions
if (!_options.VideoFileExtensions.Contains(extension, StringComparer.OrdinalIgnoreCase))
{
- var stubResult = StubResolver.ResolveFile(path, _options);
-
- isStub = stubResult.IsStub;
-
// It's not supported. Check stub extensions
- if (!isStub)
+ if (!StubResolver.TryResolveFile(path, _options, out stubType))
{
return null;
}
- stubType = stubResult.StubType;
+ isStub = true;
}
container = extension.TrimStart('.');