aboutsummaryrefslogtreecommitdiff
path: root/Emby.Naming/AudioBook/AudioBookFilePathParser.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2019-08-19 14:57:48 -0400
committerGitHub <noreply@github.com>2019-08-19 14:57:48 -0400
commitd95c04787cc4486f4ea5caaef20f6ac407a3f84a (patch)
tree7e3193614c5a132ae63034c2bb7e07956a5670e6 /Emby.Naming/AudioBook/AudioBookFilePathParser.cs
parent3ba709fcc32d7255a2cb2466dde8c2479130a2bc (diff)
parentd99278da1dcac4d3c60739e864597aa01f916636 (diff)
Merge branch 'master' into h265
Diffstat (limited to 'Emby.Naming/AudioBook/AudioBookFilePathParser.cs')
-rw-r--r--Emby.Naming/AudioBook/AudioBookFilePathParser.cs13
1 files changed, 7 insertions, 6 deletions
diff --git a/Emby.Naming/AudioBook/AudioBookFilePathParser.cs b/Emby.Naming/AudioBook/AudioBookFilePathParser.cs
index 590979794..ea7f06c8c 100644
--- a/Emby.Naming/AudioBook/AudioBookFilePathParser.cs
+++ b/Emby.Naming/AudioBook/AudioBookFilePathParser.cs
@@ -1,3 +1,4 @@
+using System;
using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
@@ -14,14 +15,13 @@ namespace Emby.Naming.AudioBook
_options = options;
}
- public AudioBookFilePathParserResult Parse(string path, bool IsDirectory)
+ public AudioBookFilePathParserResult Parse(string path)
{
- var result = Parse(path);
- return !result.Success ? new AudioBookFilePathParserResult() : result;
- }
+ if (path == null)
+ {
+ throw new ArgumentNullException(nameof(path));
+ }
- private AudioBookFilePathParserResult Parse(string path)
- {
var result = new AudioBookFilePathParserResult();
var fileName = Path.GetFileNameWithoutExtension(path);
foreach (var expression in _options.AudioBookPartsExpressions)
@@ -40,6 +40,7 @@ namespace Emby.Naming.AudioBook
}
}
}
+
if (!result.PartNumber.HasValue)
{
var value = match.Groups["part"];