mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-05 21:37:10 -04:00
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