Add Name and Year parsing for audiobooks

This commit is contained in:
Stepan
2020-11-02 20:03:12 +01:00
parent 50a2ef9d8a
commit 1e71775688
8 changed files with 163 additions and 26 deletions

View File

@@ -36,13 +36,25 @@ namespace Emby.Naming.Video
foreach (var directory in groupedDirectoryFiles)
{
var stack = new FileStack { Name = Path.GetFileName(directory.Key), IsDirectoryStack = false };
foreach (var file in directory)
if (string.IsNullOrEmpty(directory.Key))
{
stack.Files.Add(file.Path);
foreach (var file in directory)
{
var stack = new FileStack { Name = Path.GetFileNameWithoutExtension(file.Path), IsDirectoryStack = false };
stack.Files.Add(file.Path);
yield return stack;
}
}
else
{
var stack = new FileStack { Name = Path.GetFileName(directory.Key), IsDirectoryStack = false };
foreach (var file in directory)
{
stack.Files.Add(file.Path);
}
yield return stack;
yield return stack;
}
}
}