aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs
diff options
context:
space:
mode:
authorClaus Vium <cvium@users.noreply.github.com>2021-08-18 18:25:48 +0200
committerGitHub <noreply@github.com>2021-08-18 18:25:48 +0200
commit663c79cba8be58196ec210bd792388b9cf86830c (patch)
tree46fc02de09ed5419c118ecb66a25e13ae884befd /tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs
parent398ca85944c21609156892dd8c5560126336f11b (diff)
parente5cbafdb6b47377052e0d638908ef96e30a997d6 (diff)
Merge branch 'master' into baseitemkind-fixes
Diffstat (limited to 'tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs')
-rw-r--r--tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs
index d8089eea2..59037c263 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs
+++ b/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs
@@ -71,5 +71,25 @@ namespace Jellyfin.MediaEncoding.Tests.Probing
Assert.True(res.PremiereDate.HasValue);
Assert.Equal(DateTime.Parse("2021-01-01T00:00Z", DateTimeFormatInfo.CurrentInfo).ToUniversalTime(), res.PremiereDate);
}
+
+ [Fact]
+ public void GetMediaInfo_GivenOriginalDateContainsOnlyYear_Success()
+ {
+ var bytes = File.ReadAllBytes("Test Data/Probing/music_year_only_metadata.json");
+ var internalMediaInfoResult = JsonSerializer.Deserialize<InternalMediaInfoResult>(bytes, _jsonOptions);
+ MediaInfo res = _probeResultNormalizer.GetMediaInfo(internalMediaInfoResult, null, true, "Test Data/Probing/music.flac", MediaProtocol.File);
+
+ Assert.Equal("Baker Street", res.Name);
+ Assert.Single(res.Artists);
+ Assert.Equal("Gerry Rafferty", res.Artists[0]);
+ Assert.Equal("City to City", res.Album);
+ Assert.Equal(1978, res.ProductionYear);
+ Assert.True(res.PremiereDate.HasValue);
+ Assert.Equal(DateTime.Parse("1978-01-01T00:00Z", DateTimeFormatInfo.CurrentInfo).ToUniversalTime(), res.PremiereDate);
+ Assert.Contains("Electronic", res.Genres);
+ Assert.Contains("Ambient", res.Genres);
+ Assert.Contains("Pop", res.Genres);
+ Assert.Contains("Jazz", res.Genres);
+ }
}
}