diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2021-08-11 12:39:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-11 12:39:05 +0200 |
| commit | 408d5c78a95572925e60c847b59d4caf44e428e8 (patch) | |
| tree | 41b6de3cdd6d8c353901d36c71f6f8e1d45b0217 /tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs | |
| parent | c2de5f2c234f32134080428ff7307fe26b42237a (diff) | |
| parent | 8d5b87025b9e34eaa3d67c97d4a8a380b52c6830 (diff) | |
Merge pull request #6262 from MrTimscampi/scanner-prefer-original-date
Diffstat (limited to 'tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs')
| -rw-r--r-- | tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs | 20 |
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); + } } } |
