Merge pull request #2299 from dkanada/testing
Fix a few more tests for music and episodes
This commit is contained in:
commit
f23434f4f7
|
@ -13,7 +13,7 @@ jobs:
|
|||
- job: CompatibilityCheck
|
||||
displayName: Compatibility Check
|
||||
pool:
|
||||
vmImage: "${{ parameters.LinuxImage}}"
|
||||
vmImage: "${{ parameters.LinuxImage }}"
|
||||
# only execute for pull requests
|
||||
condition: and(succeeded(), variables['System.PullRequest.PullRequestNumber'])
|
||||
strategy:
|
||||
|
|
|
@ -23,32 +23,32 @@ jobs:
|
|||
|
||||
- task: CmdLine@2
|
||||
displayName: "Clone Web Client (Master, Release, or Tag)"
|
||||
condition: and(succeeded(), or(contains(variables['Build.SourceBranch'], 'release'), contains(variables['Build.SourceBranch'], 'master')) ,eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'BuildCompletion'))
|
||||
condition: and(succeeded(), or(contains(variables['Build.SourceBranch'], 'release'), contains(variables['Build.SourceBranch'], 'master')), eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'BuildCompletion'))
|
||||
inputs:
|
||||
script: "git clone --single-branch --branch $(Build.SourceBranchName) --depth=1 https://github.com/jellyfin/jellyfin-web.git $(Agent.TempDirectory)/jellyfin-web"
|
||||
|
||||
- task: CmdLine@2
|
||||
displayName: "Clone Web Client (PR)"
|
||||
condition: and(succeeded(), or(contains(variables['System.PullRequest.TargetBranch'], 'release'), contains(variables['System.PullRequest.TargetBranch'], 'master')) ,eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'PullRequest'))
|
||||
condition: and(succeeded(), or(contains(variables['System.PullRequest.TargetBranch'], 'release'), contains(variables['System.PullRequest.TargetBranch'], 'master')), eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'PullRequest'))
|
||||
inputs:
|
||||
script: "git clone --single-branch --branch $(System.PullRequest.TargetBranch) --depth 1 https://github.com/jellyfin/jellyfin-web.git $(Agent.TempDirectory)/jellyfin-web"
|
||||
|
||||
- task: NodeTool@0
|
||||
displayName: "Install Node"
|
||||
condition: and(succeeded(), or(contains(variables['System.PullRequest.TargetBranch'], 'release'), contains(variables['System.PullRequest.TargetBranch'], 'master'), contains(variables['Build.SourceBranch'], 'release'), contains(variables['Build.SourceBranch'], 'master')) ,eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'PullRequest', 'IndividualCI', 'BatchedCI', 'BuildCompletion'))
|
||||
condition: and(succeeded(), or(contains(variables['System.PullRequest.TargetBranch'], 'release'), contains(variables['System.PullRequest.TargetBranch'], 'master'), contains(variables['Build.SourceBranch'], 'release'), contains(variables['Build.SourceBranch'], 'master')), eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'PullRequest', 'IndividualCI', 'BatchedCI', 'BuildCompletion'))
|
||||
inputs:
|
||||
versionSpec: "10.x"
|
||||
|
||||
- task: CmdLine@2
|
||||
displayName: "Build Web Client"
|
||||
condition: and(succeeded(), or(contains(variables['System.PullRequest.TargetBranch'], 'release'), contains(variables['System.PullRequest.TargetBranch'], 'master'), contains(variables['Build.SourceBranch'], 'release'), contains(variables['Build.SourceBranch'], 'master')) ,eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'PullRequest', 'IndividualCI', 'BatchedCI', 'BuildCompletion'))
|
||||
condition: and(succeeded(), or(contains(variables['System.PullRequest.TargetBranch'], 'release'), contains(variables['System.PullRequest.TargetBranch'], 'master'), contains(variables['Build.SourceBranch'], 'release'), contains(variables['Build.SourceBranch'], 'master')), eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'PullRequest', 'IndividualCI', 'BatchedCI', 'BuildCompletion'))
|
||||
inputs:
|
||||
script: yarn install
|
||||
workingDirectory: $(Agent.TempDirectory)/jellyfin-web
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: "Copy Web Client"
|
||||
condition: and(succeeded(), or(contains(variables['System.PullRequest.TargetBranch'], 'release'), contains(variables['System.PullRequest.TargetBranch'], 'master'), contains(variables['Build.SourceBranch'], 'release'), contains(variables['Build.SourceBranch'], 'master')) ,eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'PullRequest', 'IndividualCI', 'BatchedCI', 'BuildCompletion'))
|
||||
condition: and(succeeded(), or(contains(variables['System.PullRequest.TargetBranch'], 'release'), contains(variables['System.PullRequest.TargetBranch'], 'master'), contains(variables['Build.SourceBranch'], 'release'), contains(variables['Build.SourceBranch'], 'master')), eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'PullRequest', 'IndividualCI', 'BatchedCI', 'BuildCompletion'))
|
||||
inputs:
|
||||
sourceFolder: $(Agent.TempDirectory)/jellyfin-web/dist
|
||||
contents: "**"
|
||||
|
@ -74,28 +74,28 @@ jobs:
|
|||
|
||||
- task: PublishPipelineArtifact@0
|
||||
displayName: "Publish Artifact Naming"
|
||||
condition: and(eq(variables['BuildConfiguration'], 'Release'), succeeded())
|
||||
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Release'))
|
||||
inputs:
|
||||
targetPath: "$(build.artifactstagingdirectory)/Jellyfin.Server/Emby.Naming.dll"
|
||||
artifactName: "Jellyfin.Naming"
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
displayName: "Publish Artifact Controller"
|
||||
condition: and(eq(variables['BuildConfiguration'], 'Release'), succeeded())
|
||||
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Release'))
|
||||
inputs:
|
||||
targetPath: "$(build.artifactstagingdirectory)/Jellyfin.Server/MediaBrowser.Controller.dll"
|
||||
artifactName: "Jellyfin.Controller"
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
displayName: "Publish Artifact Model"
|
||||
condition: and(eq(variables['BuildConfiguration'], 'Release'), succeeded())
|
||||
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Release'))
|
||||
inputs:
|
||||
targetPath: "$(build.artifactstagingdirectory)/Jellyfin.Server/MediaBrowser.Model.dll"
|
||||
artifactName: "Jellyfin.Model"
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
displayName: "Publish Artifact Common"
|
||||
condition: and(eq(variables['BuildConfiguration'], 'Release'), succeeded())
|
||||
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Release'))
|
||||
inputs:
|
||||
targetPath: "$(build.artifactstagingdirectory)/Jellyfin.Server/MediaBrowser.Common.dll"
|
||||
artifactName: "Jellyfin.Common"
|
||||
|
|
|
@ -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,31 +69,15 @@ 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]
|
||||
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"));
|
||||
}
|
||||
|
||||
// [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"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestEpisodeNumber57()
|
||||
{
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
<RootNamespace>Jellyfin.Server.Implementations.Tests</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user