diff options
| author | Fernando Fernández <ferferga.fer@gmail.com> | 2020-11-19 23:18:25 +0100 |
|---|---|---|
| committer | Fernando Fernández <ferferga.fer@gmail.com> | 2020-11-19 23:18:25 +0100 |
| commit | e21e00cad514159e22ddf99f26a4f8c13e16cc52 (patch) | |
| tree | 993002ddcb4815660de00392a7498b9dbbfa973e /Emby.Naming/AudioBook/AudioBookFilePathParser.cs | |
| parent | 2deda0437d32016a0c73158840c9c04bc729b261 (diff) | |
| parent | b5ff91c28159695858f24f768b5f6b5b33c0680c (diff) | |
Merge remote-tracking branch 'upstream/master' into no-scaling
Diffstat (limited to 'Emby.Naming/AudioBook/AudioBookFilePathParser.cs')
| -rw-r--r-- | Emby.Naming/AudioBook/AudioBookFilePathParser.cs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Emby.Naming/AudioBook/AudioBookFilePathParser.cs b/Emby.Naming/AudioBook/AudioBookFilePathParser.cs index 14edd6492..7b4429ab1 100644 --- a/Emby.Naming/AudioBook/AudioBookFilePathParser.cs +++ b/Emby.Naming/AudioBook/AudioBookFilePathParser.cs @@ -1,6 +1,3 @@ -#nullable enable -#pragma warning disable CS1591 - using System.Globalization; using System.IO; using System.Text.RegularExpressions; @@ -8,15 +5,27 @@ using Emby.Naming.Common; namespace Emby.Naming.AudioBook { + /// <summary> + /// Parser class to extract part and/or chapter number from audiobook filename. + /// </summary> public class AudioBookFilePathParser { private readonly NamingOptions _options; + /// <summary> + /// Initializes a new instance of the <see cref="AudioBookFilePathParser"/> class. + /// </summary> + /// <param name="options">Naming options containing AudioBookPartsExpressions.</param> public AudioBookFilePathParser(NamingOptions options) { _options = options; } + /// <summary> + /// Based on regex determines if filename includes part/chapter number. + /// </summary> + /// <param name="path">Path to audiobook file.</param> + /// <returns>Returns <see cref="AudioBookFilePathParser"/> object.</returns> public AudioBookFilePathParserResult Parse(string path) { AudioBookFilePathParserResult result = default; @@ -52,8 +61,6 @@ namespace Emby.Naming.AudioBook } } - result.Success = result.ChapterNumber.HasValue || result.PartNumber.HasValue; - return result; } } |
