|
|
@ -33,11 +33,7 @@ namespace Emby.Naming.Video
|
|
|
|
// See the unit test TestStackedWithTrailer
|
|
|
|
// See the unit test TestStackedWithTrailer
|
|
|
|
var nonExtras = videoInfos
|
|
|
|
var nonExtras = videoInfos
|
|
|
|
.Where(i => i.ExtraType == null)
|
|
|
|
.Where(i => i.ExtraType == null)
|
|
|
|
.Select(i => new FileSystemMetadata
|
|
|
|
.Select(i => new FileSystemMetadata { FullName = i.Path, IsDirectory = i.IsDirectory });
|
|
|
|
{
|
|
|
|
|
|
|
|
FullName = i.Path,
|
|
|
|
|
|
|
|
IsDirectory = i.IsDirectory
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var stackResult = new StackResolver(_options)
|
|
|
|
var stackResult = new StackResolver(_options)
|
|
|
|
.Resolve(nonExtras).ToList();
|
|
|
|
.Resolve(nonExtras).ToList();
|
|
|
@ -57,11 +53,7 @@ namespace Emby.Naming.Video
|
|
|
|
|
|
|
|
|
|
|
|
info.Year = info.Files[0].Year;
|
|
|
|
info.Year = info.Files[0].Year;
|
|
|
|
|
|
|
|
|
|
|
|
var extraBaseNames = new List<string>
|
|
|
|
var extraBaseNames = new List<string> { stack.Name, Path.GetFileNameWithoutExtension(stack.Files[0]) };
|
|
|
|
{
|
|
|
|
|
|
|
|
stack.Name,
|
|
|
|
|
|
|
|
Path.GetFileNameWithoutExtension(stack.Files[0])
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var extras = GetExtras(remainingFiles, extraBaseNames);
|
|
|
|
var extras = GetExtras(remainingFiles, extraBaseNames);
|
|
|
|
|
|
|
|
|
|
|
@ -83,10 +75,7 @@ namespace Emby.Naming.Video
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var media in standaloneMedia)
|
|
|
|
foreach (var media in standaloneMedia)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var info = new VideoInfo(media.Name)
|
|
|
|
var info = new VideoInfo(media.Name) { Files = new List<VideoFileInfo> { media } };
|
|
|
|
{
|
|
|
|
|
|
|
|
Files = new List<VideoFileInfo> { media }
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info.Year = info.Files[0].Year;
|
|
|
|
info.Year = info.Files[0].Year;
|
|
|
|
|
|
|
|
|
|
|
@ -222,8 +211,8 @@ namespace Emby.Naming.Video
|
|
|
|
{
|
|
|
|
{
|
|
|
|
testFilename = testFilename.Substring(folderName.Length).Trim();
|
|
|
|
testFilename = testFilename.Substring(folderName.Length).Trim();
|
|
|
|
return string.IsNullOrEmpty(testFilename)
|
|
|
|
return string.IsNullOrEmpty(testFilename)
|
|
|
|
|| testFilename[0] == '-'
|
|
|
|
|| testFilename[0] == '-'
|
|
|
|
|| string.IsNullOrWhiteSpace(Regex.Replace(testFilename, @"\[([^]]*)\]", string.Empty));
|
|
|
|
|| string.IsNullOrWhiteSpace(Regex.Replace(testFilename, @"\[([^]]*)\]", string.Empty));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -239,7 +228,8 @@ namespace Emby.Naming.Video
|
|
|
|
|
|
|
|
|
|
|
|
return remainingFiles
|
|
|
|
return remainingFiles
|
|
|
|
.Where(i => i.ExtraType == null)
|
|
|
|
.Where(i => i.ExtraType == null)
|
|
|
|
.Where(i => baseNames.Any(b => i.FileNameWithoutExtension.StartsWith(b, StringComparison.OrdinalIgnoreCase)))
|
|
|
|
.Where(i => baseNames.Any(b =>
|
|
|
|
|
|
|
|
i.FileNameWithoutExtension.StartsWith(b, StringComparison.OrdinalIgnoreCase)))
|
|
|
|
.ToList();
|
|
|
|
.ToList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|