implement suggestions
This commit is contained in:
parent
261a2e1989
commit
18906d0205
|
@ -31,8 +31,12 @@ namespace Emby.Naming.Video
|
||||||
|
|
||||||
public IEnumerable<FileStack> ResolveAudioBooks(IEnumerable<FileSystemMetadata> files)
|
public IEnumerable<FileStack> ResolveAudioBooks(IEnumerable<FileSystemMetadata> files)
|
||||||
{
|
{
|
||||||
foreach (var directory in files.GroupBy(file =>
|
var groupedDirectoryFiles = files.GroupBy(file =>
|
||||||
file.IsDirectory ? file.FullName : Path.GetDirectoryName(file.FullName)))
|
file.IsDirectory
|
||||||
|
? file.FullName
|
||||||
|
: Path.GetDirectoryName(file.FullName));
|
||||||
|
|
||||||
|
foreach (var directory in groupedDirectoryFiles)
|
||||||
{
|
{
|
||||||
var stack = new FileStack { Name = Path.GetFileName(directory.Key), IsDirectoryStack = false };
|
var stack = new FileStack { Name = Path.GetFileName(directory.Key), IsDirectoryStack = false };
|
||||||
foreach (var file in directory)
|
foreach (var file in directory)
|
||||||
|
|
|
@ -151,7 +151,8 @@ namespace Emby.Naming.Video
|
||||||
// Whatever files are left, just add them
|
// Whatever files are left, just add them
|
||||||
list.AddRange(remainingFiles.Select(i => new VideoInfo(i.Name)
|
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;
|
return list;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user