implement suggestions

This commit is contained in:
crobibero 2020-03-25 14:33:44 -06:00
parent 261a2e1989
commit 18906d0205
2 changed files with 8 additions and 3 deletions

View File

@ -31,8 +31,12 @@ namespace Emby.Naming.Video
public IEnumerable<FileStack> ResolveAudioBooks(IEnumerable<FileSystemMetadata> files)
{
foreach (var directory in files.GroupBy(file =>
file.IsDirectory ? file.FullName : Path.GetDirectoryName(file.FullName)))
var groupedDirectoryFiles = files.GroupBy(file =>
file.IsDirectory
? file.FullName
: Path.GetDirectoryName(file.FullName));
foreach (var directory in groupedDirectoryFiles)
{
var stack = new FileStack { Name = Path.GetFileName(directory.Key), IsDirectoryStack = false };
foreach (var file in directory)

View File

@ -151,7 +151,8 @@ namespace Emby.Naming.Video
// Whatever files are left, just add them
list.AddRange(remainingFiles.Select(i => new VideoInfo(i.Name)
{
Files = new List<VideoFileInfo> { i }, Year = i.Year
Files = new List<VideoFileInfo> { i },
Year = i.Year
}));
return list;