From 18906d0205f99e27141b45282fd28ae9a97e93e4 Mon Sep 17 00:00:00 2001 From: crobibero Date: Wed, 25 Mar 2020 14:33:44 -0600 Subject: [PATCH] implement suggestions --- Emby.Naming/Video/StackResolver.cs | 8 ++++++-- Emby.Naming/Video/VideoListResolver.cs | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Emby.Naming/Video/StackResolver.cs b/Emby.Naming/Video/StackResolver.cs index a943839f2..f733cd262 100644 --- a/Emby.Naming/Video/StackResolver.cs +++ b/Emby.Naming/Video/StackResolver.cs @@ -31,8 +31,12 @@ namespace Emby.Naming.Video public IEnumerable ResolveAudioBooks(IEnumerable 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) diff --git a/Emby.Naming/Video/VideoListResolver.cs b/Emby.Naming/Video/VideoListResolver.cs index 29b42cdc1..125228b36 100644 --- a/Emby.Naming/Video/VideoListResolver.cs +++ b/Emby.Naming/Video/VideoListResolver.cs @@ -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 { i }, Year = i.Year + Files = new List { i }, + Year = i.Year })); return list;