|
|
@ -175,11 +175,15 @@ namespace Emby.Naming.Video
|
|
|
|
return videos;
|
|
|
|
return videos;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return videos.GroupBy(v => new {v.Name, v.Year}).Select(group => new VideoInfo
|
|
|
|
var folderName = Path.GetFileName(Path.GetDirectoryName(videos[0].Files[0].Path));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(folderName) && folderName.Length > 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var ordered = videos.OrderBy(i => i.Name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ordered.GroupBy(v => new {v.Name, v.Year}).Select(group => new VideoInfo
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Because of the grouping, we can grab the information from the first movie and make it primary
|
|
|
|
Name = folderName,
|
|
|
|
// The remaining movie matches are 'alternate versions'
|
|
|
|
|
|
|
|
Name = group.First().Name,
|
|
|
|
|
|
|
|
Year = group.First().Year,
|
|
|
|
Year = group.First().Year,
|
|
|
|
Files = group.First().Files,
|
|
|
|
Files = group.First().Files,
|
|
|
|
AlternateVersions = group.Skip(1).Select(i => i.Files[0]).ToList(),
|
|
|
|
AlternateVersions = group.Skip(1).Select(i => i.Files[0]).ToList(),
|
|
|
@ -187,6 +191,9 @@ namespace Emby.Naming.Video
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return videos;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private List<VideoFileInfo> GetExtras(IEnumerable<VideoFileInfo> remainingFiles, List<string> baseNames)
|
|
|
|
private List<VideoFileInfo> GetExtras(IEnumerable<VideoFileInfo> remainingFiles, List<string> baseNames)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach (var name in baseNames.ToList())
|
|
|
|
foreach (var name in baseNames.ToList())
|
|
|
|