aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Server.Implementations.Tests/Library/LibraryManager
diff options
context:
space:
mode:
authorRonan Charles-Lorel <roro.roronoa@gmail.com>2023-06-29 15:08:52 +0200
committerGitHub <noreply@github.com>2023-06-29 15:08:52 +0200
commite108183b138552013bbfd13c36937481228eb9e6 (patch)
tree8e374adf35d64b157ac88e5b84a25d186bd4ccf1 /tests/Jellyfin.Server.Implementations.Tests/Library/LibraryManager
parent31ac861b8560547c7e0c46513077abf76e6bc618 (diff)
parentb5bbb98175e0542d43c01f80c15e8dce04e58b53 (diff)
Merge branch 'jellyfin:master' into master
Diffstat (limited to 'tests/Jellyfin.Server.Implementations.Tests/Library/LibraryManager')
-rw-r--r--tests/Jellyfin.Server.Implementations.Tests/Library/LibraryManager/FindExtrasTests.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Library/LibraryManager/FindExtrasTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Library/LibraryManager/FindExtrasTests.cs
index 599599071..562711337 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/Library/LibraryManager/FindExtrasTests.cs
+++ b/tests/Jellyfin.Server.Implementations.Tests/Library/LibraryManager/FindExtrasTests.cs
@@ -80,6 +80,35 @@ public class FindExtrasTests
}
[Fact]
+ public void FindExtras_SeparateMovieFolder_CleanExtraNames()
+ {
+ var owner = new Movie { Name = "Up", Path = "/movies/Up/Up.mkv" };
+ var paths = new List<string>
+ {
+ "/movies/Up/Up.mkv",
+ "/movies/Up/Recording the audio[Bluray]-behindthescenes.mkv",
+ "/movies/Up/Interview with the dog-interview.mkv",
+ "/movies/Up/shorts/Balloons[1080p].mkv"
+ };
+
+ var files = paths.Select(p => new FileSystemMetadata
+ {
+ FullName = p,
+ IsDirectory = false
+ }).ToList();
+
+ var extras = _libraryManager.FindExtras(owner, files, new DirectoryService(_fileSystemMock.Object)).OrderBy(e => e.ExtraType).ToList();
+
+ Assert.Equal(3, extras.Count);
+ Assert.Equal(ExtraType.BehindTheScenes, extras[0].ExtraType);
+ Assert.Equal("Recording the audio", extras[0].Name);
+ Assert.Equal(ExtraType.Interview, extras[1].ExtraType);
+ Assert.Equal("Interview with the dog", extras[1].Name);
+ Assert.Equal(ExtraType.Short, extras[2].ExtraType);
+ Assert.Equal("Balloons", extras[2].Name);
+ }
+
+ [Fact]
public void FindExtras_SeparateMovieFolderWithMixedExtras_FindsCorrectExtras()
{
var owner = new Movie { Name = "Up", Path = "/movies/Up/Up.mkv" };