|
|
@ -26,14 +26,16 @@ namespace Jellyfin.Naming.Tests.AudioBook
|
|
|
|
"Batman/Chapter 2.mp3",
|
|
|
|
"Batman/Chapter 2.mp3",
|
|
|
|
"Batman/Chapter 3.mp3",
|
|
|
|
"Batman/Chapter 3.mp3",
|
|
|
|
|
|
|
|
|
|
|
|
"Ready Player One (2020)/Ready Player One.mp3",
|
|
|
|
|
|
|
|
"Ready Player One (2020)/extra.mp3",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"Badman/audiobook.mp3",
|
|
|
|
"Badman/audiobook.mp3",
|
|
|
|
"Badman/extra.mp3",
|
|
|
|
"Badman/extra.mp3",
|
|
|
|
|
|
|
|
|
|
|
|
"Superman (2020)/book.mp3",
|
|
|
|
"Superman (2020)/Part 1.mp3",
|
|
|
|
"Superman (2020)/extra.mp3"
|
|
|
|
"Superman (2020)/extra.mp3",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"Ready Player One (2020)/audiobook.mp3",
|
|
|
|
|
|
|
|
"Ready Player One (2020)/extra.mp3",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
".mp3"
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var resolver = GetResolver();
|
|
|
|
var resolver = GetResolver();
|
|
|
@ -44,7 +46,9 @@ namespace Jellyfin.Naming.Tests.AudioBook
|
|
|
|
FullName = i
|
|
|
|
FullName = i
|
|
|
|
})).ToList();
|
|
|
|
})).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(4, result[0].Files.Count);
|
|
|
|
Assert.Equal(5, result.Count);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(2, result[0].Files.Count);
|
|
|
|
Assert.Single(result[0].Extras);
|
|
|
|
Assert.Single(result[0].Extras);
|
|
|
|
Assert.Equal("Harry Potter and the Deathly Hallows", result[0].Name);
|
|
|
|
Assert.Equal("Harry Potter and the Deathly Hallows", result[0].Name);
|
|
|
|
|
|
|
|
|
|
|
@ -52,13 +56,17 @@ namespace Jellyfin.Naming.Tests.AudioBook
|
|
|
|
Assert.Empty(result[1].Extras);
|
|
|
|
Assert.Empty(result[1].Extras);
|
|
|
|
Assert.Equal("Batman", result[1].Name);
|
|
|
|
Assert.Equal("Batman", result[1].Name);
|
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(2, result[2].Files.Count);
|
|
|
|
Assert.Single(result[2].Files);
|
|
|
|
Assert.Single(result[2].Extras);
|
|
|
|
Assert.Single(result[2].Extras);
|
|
|
|
Assert.Equal("Badman", result[2].Name);
|
|
|
|
Assert.Equal("Badman", result[2].Name);
|
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(2, result[3].Files.Count);
|
|
|
|
Assert.Single(result[3].Files);
|
|
|
|
Assert.Single(result[3].Extras);
|
|
|
|
Assert.Single(result[3].Extras);
|
|
|
|
Assert.Equal("Superman", result[3].Name);
|
|
|
|
Assert.Equal("Superman", result[3].Name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.Single(result[4].Files);
|
|
|
|
|
|
|
|
Assert.Single(result[4].Extras);
|
|
|
|
|
|
|
|
Assert.Equal("Ready Player One", result[4].Name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
@ -69,12 +77,9 @@ namespace Jellyfin.Naming.Tests.AudioBook
|
|
|
|
"Harry Potter and the Deathly Hallows/Chapter 1.ogg",
|
|
|
|
"Harry Potter and the Deathly Hallows/Chapter 1.ogg",
|
|
|
|
"Harry Potter and the Deathly Hallows/Chapter 1.mp3",
|
|
|
|
"Harry Potter and the Deathly Hallows/Chapter 1.mp3",
|
|
|
|
|
|
|
|
|
|
|
|
"Aqua-man/book.mp3",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"Deadpool.mp3",
|
|
|
|
"Deadpool.mp3",
|
|
|
|
"Deadpool [HQ].mp3",
|
|
|
|
"Deadpool [HQ].mp3",
|
|
|
|
|
|
|
|
|
|
|
|
"Superman/book.mp3",
|
|
|
|
|
|
|
|
"Superman/audiobook.mp3",
|
|
|
|
"Superman/audiobook.mp3",
|
|
|
|
"Superman/Superman.mp3",
|
|
|
|
"Superman/Superman.mp3",
|
|
|
|
"Superman/Superman [HQ].mp3",
|
|
|
|
"Superman/Superman [HQ].mp3",
|
|
|
@ -92,27 +97,24 @@ namespace Jellyfin.Naming.Tests.AudioBook
|
|
|
|
FullName = i
|
|
|
|
FullName = i
|
|
|
|
})).ToList();
|
|
|
|
})).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(6, result[0].Files.Count);
|
|
|
|
Assert.Equal(5, result.Count);
|
|
|
|
// HP - Same name so we don't care which file is alternative
|
|
|
|
// HP - Same name so we don't care which file is alternative
|
|
|
|
Assert.Single(result[0].AlternateVersions);
|
|
|
|
Assert.Single(result[0].AlternateVersions);
|
|
|
|
// Aqua-man
|
|
|
|
|
|
|
|
Assert.Empty(result[1].AlternateVersions);
|
|
|
|
|
|
|
|
// DP
|
|
|
|
// DP
|
|
|
|
Assert.Empty(result[2].AlternateVersions);
|
|
|
|
Assert.Empty(result[1].AlternateVersions);
|
|
|
|
// DP HQ (directory missing so we do not group deadpools together)
|
|
|
|
// DP HQ (directory missing so we do not group deadpools together)
|
|
|
|
Assert.Empty(result[3].AlternateVersions);
|
|
|
|
Assert.Empty(result[2].AlternateVersions);
|
|
|
|
// Superman
|
|
|
|
// Superman
|
|
|
|
// Priority:
|
|
|
|
// Priority:
|
|
|
|
// 1. Name
|
|
|
|
// 1. Name
|
|
|
|
// 2. audiobook
|
|
|
|
// 2. audiobook
|
|
|
|
// 3. book
|
|
|
|
// 3. Names with modifiers
|
|
|
|
// 4. Names with modifiers
|
|
|
|
Assert.Equal(2, result[3].AlternateVersions.Count);
|
|
|
|
Assert.Equal(3, result[4].AlternateVersions.Count);
|
|
|
|
var paths = result[3].AlternateVersions.Select(x => x.Path).ToList();
|
|
|
|
Assert.Equal("Superman/audiobook.mp3", result[4].AlternateVersions[0].Path);
|
|
|
|
Assert.Contains("Superman/audiobook.mp3", paths);
|
|
|
|
Assert.Equal("Superman/book.mp3", result[4].AlternateVersions[1].Path);
|
|
|
|
Assert.Contains("Superman/Superman [HQ].mp3", paths);
|
|
|
|
Assert.Equal("Superman/Superman [HQ].mp3", result[4].AlternateVersions[2].Path);
|
|
|
|
|
|
|
|
// Batman
|
|
|
|
// Batman
|
|
|
|
Assert.Single(result[5].AlternateVersions);
|
|
|
|
Assert.Single(result[4].AlternateVersions);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|