diff options
| author | David Ullmer <davidullmer@outlook.de> | 2022-02-08 09:09:33 +0100 |
|---|---|---|
| committer | David Ullmer <davidullmer@outlook.de> | 2022-02-08 09:09:33 +0100 |
| commit | fdfcb45c2aee2febfa428e339dc3cad7a221066e (patch) | |
| tree | 61adf0f70bfb0402c4d6595bcdcd733fb143250a | |
| parent | 7885167f547dfa3f73aec22996c0e22b65dbd84f (diff) | |
Add regression test for #7285
| -rw-r--r-- | tests/Jellyfin.XbmcMetadata.Tests/Parsers/EpisodeNfoProviderTests.cs | 14 | ||||
| -rw-r--r-- | tests/Jellyfin.XbmcMetadata.Tests/Test Data/Sonarr-Thumb.nfo | 34 |
2 files changed, 48 insertions, 0 deletions
diff --git a/tests/Jellyfin.XbmcMetadata.Tests/Parsers/EpisodeNfoProviderTests.cs b/tests/Jellyfin.XbmcMetadata.Tests/Parsers/EpisodeNfoProviderTests.cs index 3e726f23d..073214083 100644 --- a/tests/Jellyfin.XbmcMetadata.Tests/Parsers/EpisodeNfoProviderTests.cs +++ b/tests/Jellyfin.XbmcMetadata.Tests/Parsers/EpisodeNfoProviderTests.cs @@ -123,6 +123,20 @@ namespace Jellyfin.XbmcMetadata.Tests.Parsers } [Fact] + public void Parse_GivenFileWithThumbWithoutAspect_Success() + { + var result = new MetadataResult<Episode>() + { + Item = new Episode() + }; + + _parser.Fetch(result, "Test Data/Sonarr-Thumb.nfo", CancellationToken.None); + + Assert.Single(result.RemoteImages.Where(x => x.Type == ImageType.Primary)); + Assert.Equal("https://artworks.thetvdb.com/banners/episodes/359095/7081317.jpg", result.RemoteImages.First(x => x.Type == ImageType.Primary).Url); + } + + [Fact] public void Fetch_WithNullItem_ThrowsArgumentException() { var result = new MetadataResult<Episode>(); diff --git a/tests/Jellyfin.XbmcMetadata.Tests/Test Data/Sonarr-Thumb.nfo b/tests/Jellyfin.XbmcMetadata.Tests/Test Data/Sonarr-Thumb.nfo new file mode 100644 index 000000000..fb86768ef --- /dev/null +++ b/tests/Jellyfin.XbmcMetadata.Tests/Test Data/Sonarr-Thumb.nfo @@ -0,0 +1,34 @@ +<episodedetails> + <title>Sometimes a Genius's Every Action Is at the Mercy of X</title> + <season>1</season> + <episode>8</episode> + <aired>2019-05-26</aired> + <plot>After Nariyuki wins a smartphone in a lottery, he can't wait to use it for apps like the dictionary, schedule managing, and the like. He also learns that studying in the bathtub is effective and quickly puts the method into practice.</plot> + <uniqueid type="sonarr" default="true">4289</uniqueid> + <thumb>https://artworks.thetvdb.com/banners/episodes/359095/7081317.jpg</thumb> + <watched>false</watched> + <fileinfo> + <streamdetails> + <video> + <aspect>1.77777779</aspect> + <bitrate>2208901</bitrate> + <codec>x265</codec> + <framerate>23.976</framerate> + <height>1080</height> + <scantype></scantype> + <width>1920</width> + <duration>23.683416666666666</duration> + <durationinseconds>1421</durationinseconds> + </video> + <audio> + <bitrate>1468567</bitrate> + <channels>2</channels> + <codec>FLAC</codec> + <language>Japanese / Japanese</language> + </audio> + <subtitle> + <language>English</language> + </subtitle> + </streamdetails> + </fileinfo> +</episodedetails> |
