aboutsummaryrefslogtreecommitdiff
path: root/Emby.Naming/Video/VideoResolver.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Naming/Video/VideoResolver.cs')
-rw-r--r--Emby.Naming/Video/VideoResolver.cs21
1 files changed, 10 insertions, 11 deletions
diff --git a/Emby.Naming/Video/VideoResolver.cs b/Emby.Naming/Video/VideoResolver.cs
index c4951c728e..a673156517 100644
--- a/Emby.Naming/Video/VideoResolver.cs
+++ b/Emby.Naming/Video/VideoResolver.cs
@@ -1,7 +1,7 @@
-using Emby.Naming.Common;
using System;
using System.IO;
using System.Linq;
+using Emby.Naming.Common;
namespace Emby.Naming.Video
{
@@ -40,25 +40,25 @@ namespace Emby.Naming.Video
/// <param name="path">The path.</param>
/// <param name="IsDirectory">if set to <c>true</c> [is folder].</param>
/// <returns>VideoFileInfo.</returns>
- /// <exception cref="System.ArgumentNullException">path</exception>
+ /// <exception cref="ArgumentNullException">path</exception>
public VideoFileInfo Resolve(string path, bool IsDirectory, bool parseName = true)
{
if (string.IsNullOrEmpty(path))
{
- throw new ArgumentNullException("path");
+ throw new ArgumentNullException(nameof(path));
}
- var isStub = false;
+ bool isStub = false;
string container = null;
string stubType = null;
if (!IsDirectory)
{
- var extension = Path.GetExtension(path) ?? string.Empty;
+ var extension = Path.GetExtension(path);
// Check supported extensions
if (!_options.VideoFileExtensions.Contains(extension, StringComparer.OrdinalIgnoreCase))
{
- var stubResult = new StubResolver(_options).ResolveFile(path);
+ var stubResult = StubResolver.ResolveFile(path, _options);
isStub = stubResult.IsStub;
@@ -79,9 +79,9 @@ namespace Emby.Naming.Video
var extraResult = new ExtraResolver(_options).GetExtraInfo(path);
- var name = !IsDirectory
- ? Path.GetFileNameWithoutExtension(path)
- : Path.GetFileName(path);
+ var name = IsDirectory
+ ? Path.GetFileName(path)
+ : Path.GetFileNameWithoutExtension(path);
int? year = null;
@@ -91,8 +91,7 @@ namespace Emby.Naming.Video
if (string.IsNullOrEmpty(extraResult.ExtraType))
{
- name = cleanDateTimeResult.Name;
- name = CleanString(name).Name;
+ name = CleanString(cleanDateTimeResult.Name).Name;
}
year = cleanDateTimeResult.Year;