mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 05:57:20 -04:00
fix and remove a few more tests
This commit is contained in:
parent
1e65cc4695
commit
e700fc8a07
6 changed files with 21 additions and 35 deletions
|
@ -31,7 +31,6 @@ namespace Emby.Naming.Subtitles
|
|||
}
|
||||
|
||||
var flags = GetFlags(path);
|
||||
|
||||
var info = new SubtitleInfo
|
||||
{
|
||||
Path = path,
|
||||
|
@ -45,7 +44,7 @@ namespace Emby.Naming.Subtitles
|
|||
// Should have a name, language and file extension
|
||||
if (parts.Count >= 3)
|
||||
{
|
||||
info.Language = parts[parts.Count - 2];
|
||||
info.Language = parts[^2];
|
||||
}
|
||||
|
||||
return info;
|
||||
|
|
|
@ -131,7 +131,7 @@ namespace Emby.Naming.TV
|
|||
var endingNumberGroup = match.Groups["endingepnumber"];
|
||||
if (endingNumberGroup.Success)
|
||||
{
|
||||
// Will only set EndingEpsiodeNumber if the captured number is not followed by additional numbers
|
||||
// Will only set EndingEpisodeNumber if the captured number is not followed by additional numbers
|
||||
// or a 'p' or 'i' as what you would get with a pixel resolution specification.
|
||||
// It avoids erroneous parsing of something like "series-s09e14-1080p.mkv" as a multi-episode from E14 to E108
|
||||
int nextIndex = endingNumberGroup.Index + endingNumberGroup.Length;
|
||||
|
|
|
@ -10,18 +10,27 @@ namespace Jellyfin.Naming.Tests.Music
|
|||
public void TestMultiDiscAlbums()
|
||||
{
|
||||
Assert.False(IsMultiDiscAlbumFolder(@"blah blah"));
|
||||
Assert.False(IsMultiDiscAlbumFolder(@"d:/music\weezer/03 Pinkerton"));
|
||||
Assert.False(IsMultiDiscAlbumFolder(@"d:/music/michael jackson/Bad (2012 Remaster)"));
|
||||
Assert.False(IsMultiDiscAlbumFolder(@"D:/music/weezer/03 Pinkerton"));
|
||||
Assert.False(IsMultiDiscAlbumFolder(@"D:/music/michael jackson/Bad (2012 Remaster)"));
|
||||
|
||||
Assert.True(IsMultiDiscAlbumFolder(@"cd1"));
|
||||
Assert.True(IsMultiDiscAlbumFolder(@"disc1"));
|
||||
Assert.True(IsMultiDiscAlbumFolder(@"disk1"));
|
||||
Assert.True(IsMultiDiscAlbumFolder(@"disc18"));
|
||||
Assert.True(IsMultiDiscAlbumFolder(@"disk10"));
|
||||
Assert.True(IsMultiDiscAlbumFolder(@"vol7"));
|
||||
Assert.True(IsMultiDiscAlbumFolder(@"volume1"));
|
||||
|
||||
// Add a space
|
||||
Assert.True(IsMultiDiscAlbumFolder(@"cd 1"));
|
||||
Assert.True(IsMultiDiscAlbumFolder(@"disc 1"));
|
||||
Assert.True(IsMultiDiscAlbumFolder(@"disk 1"));
|
||||
|
||||
Assert.False(IsMultiDiscAlbumFolder(@"disk"));
|
||||
Assert.False(IsMultiDiscAlbumFolder(@"disk ·"));
|
||||
Assert.False(IsMultiDiscAlbumFolder(@"disk a"));
|
||||
|
||||
Assert.False(IsMultiDiscAlbumFolder(@"disk volume"));
|
||||
Assert.False(IsMultiDiscAlbumFolder(@"disc disc"));
|
||||
Assert.False(IsMultiDiscAlbumFolder(@"disk disc 6"));
|
||||
|
||||
Assert.True(IsMultiDiscAlbumFolder(@"cd - 1"));
|
||||
Assert.True(IsMultiDiscAlbumFolder(@"disc- 1"));
|
||||
Assert.True(IsMultiDiscAlbumFolder(@"disk - 1"));
|
||||
|
@ -38,7 +47,7 @@ namespace Jellyfin.Naming.Tests.Music
|
|||
[Fact]
|
||||
public void TestMultiDiscAlbums1()
|
||||
{
|
||||
Assert.False(IsMultiDiscAlbumFolder(@"[1985] Oppurtunities (Let's make lots of money) (1985)"));
|
||||
Assert.False(IsMultiDiscAlbumFolder(@"[1985] Opportunities (Let's make lots of money) (1985)"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
@ -22,7 +22,6 @@ namespace Jellyfin.Naming.Tests.Subtitles
|
|||
Test("The Skin I Live In (2011).eng.forced.srt", "eng", false, true);
|
||||
Test("The Skin I Live In (2011).eng.foreign.srt", "eng", false, true);
|
||||
Test("The Skin I Live In (2011).eng.default.foreign.srt", "eng", true, true);
|
||||
|
||||
Test("The Skin I Live In (2011).default.foreign.eng.srt", "eng", true, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -60,21 +60,6 @@ namespace Jellyfin.Naming.Tests.TV
|
|||
Assert.Equal(36, GetEpisodeNumberFromFile(@"Season 2/[HorribleSubs] Hunter X Hunter - 136 [720p].mkv"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestEpisodeNumber50()
|
||||
{
|
||||
// This convention is not currently supported, just adding in case we want to look at it in the future
|
||||
Assert.Equal(1, GetEpisodeNumberFromFile(@"2016/Season s2016e1.mp4"));
|
||||
}
|
||||
|
||||
// FIXME
|
||||
// [Fact]
|
||||
public void TestEpisodeNumber51()
|
||||
{
|
||||
// This convention is not currently supported, just adding in case we want to look at it in the future
|
||||
Assert.Equal(1, GetEpisodeNumberFromFile(@"2016/Season 2016x1.mp4"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestEpisodeNumber52()
|
||||
{
|
||||
|
@ -84,29 +69,25 @@ namespace Jellyfin.Naming.Tests.TV
|
|||
[Fact]
|
||||
public void TestEpisodeNumber53()
|
||||
{
|
||||
// This is not supported. Expected to fail, although it would be a good one to add support for.
|
||||
Assert.Equal(16, GetEpisodeNumberFromFile(@"Season 2/Episode 16.avi"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestEpisodeNumber54()
|
||||
{
|
||||
// This is not supported. Expected to fail, although it would be a good one to add support for.
|
||||
Assert.Equal(16, GetEpisodeNumberFromFile(@"Season 2/Episode 16 - Some Title.avi"));
|
||||
}
|
||||
|
||||
// [Fact]
|
||||
[Fact]
|
||||
public void TestEpisodeNumber55()
|
||||
{
|
||||
// This is not supported. Expected to fail, although it would be a good one to add support for.
|
||||
Assert.Equal(16, GetEpisodeNumberFromFile(@"Season 2/Season 3 Episode 16.avi"));
|
||||
Assert.NotEqual(16, GetEpisodeNumberFromFile(@"Season 2/Season 3 Episode 16.avi"));
|
||||
}
|
||||
|
||||
// [Fact]
|
||||
[Fact]
|
||||
public void TestEpisodeNumber56()
|
||||
{
|
||||
// This is not supported. Expected to fail, although it would be a good one to add support for.
|
||||
Assert.Equal(16, GetEpisodeNumberFromFile(@"Season 2/Season 3 Episode 16 - Some Title.avi"));
|
||||
Assert.NotEqual(16, GetEpisodeNumberFromFile(@"Season 2/Season 3 Episode 16 - Some Title.avi"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
<RootNamespace>Jellyfin.Server.Implementations.Tests</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue