aboutsummaryrefslogtreecommitdiff
path: root/Emby.Naming
diff options
context:
space:
mode:
authorKeridos <2742845+Keridos@users.noreply.github.com>2020-09-09 01:57:09 +0200
committerKeridos <2742845+Keridos@users.noreply.github.com>2020-09-09 02:24:17 +0200
commitb9c7cce6968482145ab15603dcca218e67d1b2b9 (patch)
tree086af45917c66c563494ed3d8740c64bfa3784f0 /Emby.Naming
parentb76d4ba454c43cc6293b733f2bba363e34a9bf5e (diff)
some testing for AudioBook
fix PartNumber detection
Diffstat (limited to 'Emby.Naming')
-rw-r--r--Emby.Naming/AudioBook/AudioBookFilePathParser.cs17
-rw-r--r--Emby.Naming/AudioBook/AudioBookResolver.cs2
2 files changed, 3 insertions, 16 deletions
diff --git a/Emby.Naming/AudioBook/AudioBookFilePathParser.cs b/Emby.Naming/AudioBook/AudioBookFilePathParser.cs
index 3c874c62c..eb9393b0b 100644
--- a/Emby.Naming/AudioBook/AudioBookFilePathParser.cs
+++ b/Emby.Naming/AudioBook/AudioBookFilePathParser.cs
@@ -50,27 +50,14 @@ namespace Emby.Naming.AudioBook
{
if (int.TryParse(value.Value, NumberStyles.Integer, CultureInfo.InvariantCulture, out var intValue))
{
- result.ChapterNumber = intValue;
+ result.PartNumber = intValue;
}
}
}
}
}
- /*var matches = _iRegexProvider.GetRegex("\\d+", RegexOptions.IgnoreCase).Matches(fileName);
- if (matches.Count > 0)
- {
- if (!result.ChapterNumber.HasValue)
- {
- result.ChapterNumber = int.Parse(matches[0].Groups[0].Value);
- }
-
- if (matches.Count > 1)
- {
- result.PartNumber = int.Parse(matches[matches.Count - 1].Groups[0].Value);
- }
- }*/
- result.Success = result.PartNumber.HasValue || result.ChapterNumber.HasValue;
+ result.Success = result.ChapterNumber.HasValue || result.PartNumber.HasValue;
return result;
}
diff --git a/Emby.Naming/AudioBook/AudioBookResolver.cs b/Emby.Naming/AudioBook/AudioBookResolver.cs
index 5466b4637..ed53bd04f 100644
--- a/Emby.Naming/AudioBook/AudioBookResolver.cs
+++ b/Emby.Naming/AudioBook/AudioBookResolver.cs
@@ -55,8 +55,8 @@ namespace Emby.Naming.AudioBook
{
Path = path,
Container = container,
- PartNumber = parsingResult.PartNumber,
ChapterNumber = parsingResult.ChapterNumber,
+ PartNumber = parsingResult.PartNumber,
IsDirectory = isDirectory
};
}