diff options
| author | Anthony Lavado <anthonylavado@users.noreply.github.com> | 2019-06-05 01:17:21 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-05 01:17:21 -0400 |
| commit | aee33608417533c6335f97b32aff40ceadda1758 (patch) | |
| tree | 489d07d11c978ea3066407788084a60177c5baeb /Emby.Naming/AudioBook/AudioBookFilePathParser.cs | |
| parent | 256f44a87029577ed5daa7646c68e8a395e19708 (diff) | |
| parent | 08ac5b6ec3ce829c6691f1751e86480ace3d4b93 (diff) | |
Merge pull request #1366 from Bond-009/warn3
Fix more warnings
Diffstat (limited to 'Emby.Naming/AudioBook/AudioBookFilePathParser.cs')
| -rw-r--r-- | Emby.Naming/AudioBook/AudioBookFilePathParser.cs | 13 |
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"]; |
