Merge pull request #9496 from mammo0/fix_file_stacking
This commit is contained in:
commit
b2461feffb
|
@ -141,8 +141,7 @@ namespace Emby.Naming.Common
|
||||||
VideoFileStackingRules = new[]
|
VideoFileStackingRules = new[]
|
||||||
{
|
{
|
||||||
new FileStackRule(@"^(?<filename>.*?)(?:(?<=[\]\)\}])|[ _.-]+)[\(\[]?(?<parttype>cd|dvd|part|pt|dis[ck])[ _.-]*(?<number>[0-9]+)[\)\]]?(?:\.[^.]+)?$", true),
|
new FileStackRule(@"^(?<filename>.*?)(?:(?<=[\]\)\}])|[ _.-]+)[\(\[]?(?<parttype>cd|dvd|part|pt|dis[ck])[ _.-]*(?<number>[0-9]+)[\)\]]?(?:\.[^.]+)?$", true),
|
||||||
new FileStackRule(@"^(?<filename>.*?)(?:(?<=[\]\)\}])|[ _.-]+)[\(\[]?(?<parttype>cd|dvd|part|pt|dis[ck])[ _.-]*(?<number>[a-d])[\)\]]?(?:\.[^.]+)?$", false),
|
new FileStackRule(@"^(?<filename>.*?)(?:(?<=[\]\)\}])|[ _.-]+)[\(\[]?(?<parttype>cd|dvd|part|pt|dis[ck])[ _.-]*(?<number>[a-d])[\)\]]?(?:\.[^.]+)?$", false)
|
||||||
new FileStackRule(@"^(?<filename>.*?)(?:(?<=[\]\)\}])|[ _.-]?)(?<number>[a-d])(?:\.[^.]+)?$", false)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CleanDateTimes = new[]
|
CleanDateTimes = new[]
|
||||||
|
|
|
@ -236,7 +236,7 @@ namespace Jellyfin.Naming.Tests.Video
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void TestFalsePositive()
|
public void TestMissingParttype()
|
||||||
{
|
{
|
||||||
var files = new[]
|
var files = new[]
|
||||||
{
|
{
|
||||||
|
@ -248,9 +248,8 @@ namespace Jellyfin.Naming.Tests.Video
|
||||||
|
|
||||||
var result = StackResolver.ResolveFiles(files, _namingOptions).ToList();
|
var result = StackResolver.ResolveFiles(files, _namingOptions).ToList();
|
||||||
|
|
||||||
Assert.Single(result);
|
// There should be no stack, because all files should be treated as separate movies
|
||||||
|
Assert.Empty(result);
|
||||||
TestStackInfo(result[0], "300", 3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
@ -297,11 +296,11 @@ namespace Jellyfin.Naming.Tests.Video
|
||||||
|
|
||||||
var result = StackResolver.ResolveFiles(files, _namingOptions).ToList();
|
var result = StackResolver.ResolveFiles(files, _namingOptions).ToList();
|
||||||
|
|
||||||
Assert.Equal(3, result.Count);
|
// Only 'Bad Boys (2006)' and '300 (2006)' should be in the stack
|
||||||
|
Assert.Equal(2, result.Count);
|
||||||
|
|
||||||
TestStackInfo(result[0], "300 (2006)", 4);
|
TestStackInfo(result[0], "300 (2006)", 4);
|
||||||
TestStackInfo(result[1], "300", 3);
|
TestStackInfo(result[1], "Bad Boys (2006)", 4);
|
||||||
TestStackInfo(result[2], "Bad Boys (2006)", 4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
|
@ -332,7 +332,9 @@ namespace Jellyfin.Naming.Tests.Video
|
||||||
files.Select(i => VideoResolver.Resolve(i, false, _namingOptions)).OfType<VideoFileInfo>().ToList(),
|
files.Select(i => VideoResolver.Resolve(i, false, _namingOptions)).OfType<VideoFileInfo>().ToList(),
|
||||||
_namingOptions).ToList();
|
_namingOptions).ToList();
|
||||||
|
|
||||||
Assert.Single(result);
|
// The result should contain two individual movies
|
||||||
|
// Version grouping should not work here, because the files are not in a directory with the name 'Four Sisters and a Wedding'
|
||||||
|
Assert.Equal(2, result.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user