diff options
| author | TheMelmacian <76712303+TheMelmacian@users.noreply.github.com> | 2025-02-03 16:54:35 -0500 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2025-02-03 16:54:35 -0500 |
| commit | 51207edf44c4ec74a621a3ea9c5b9ee55c006009 (patch) | |
| tree | 6512b11c2236e6ef5418935f963dfb46bb091ca5 /tests | |
| parent | cfeb879519539573575ccc0b60c9c6010fda1543 (diff) | |
Backport pull request #13092 from jellyfin/release-10.10.z
Fix: handling of <set> elements in NfoParser
Original-merge: f333ef74b3cc8444e12ac1210f94daf59c766969
Merged-by: joshuaboniface <joshua@boniface.me>
Backported-by: Bond_009 <bond.009@outlook.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs | 18 | ||||
| -rw-r--r-- | tests/Jellyfin.XbmcMetadata.Tests/Test Data/Lilo & Stitch.nfo | 7 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs b/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs index b9833c225..9c2655154 100644 --- a/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs +++ b/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs @@ -257,5 +257,23 @@ namespace Jellyfin.XbmcMetadata.Tests.Parsers Assert.Throws<ArgumentException>(() => _parser.Fetch(result, string.Empty, CancellationToken.None)); } + + [Fact] + public void Parsing_Fields_With_Escaped_Xml_Special_Characters_Success() + { + var result = new MetadataResult<Video>() + { + Item = new Movie() + }; + + _parser.Fetch(result, "Test Data/Lilo & Stitch.nfo", CancellationToken.None); + var item = (Movie)result.Item; + + Assert.Equal("Lilo & Stitch", item.Name); + Assert.Equal("Lilo & Stitch", item.OriginalTitle); + Assert.Equal("Lilo & Stitch Collection", item.CollectionName); + Assert.StartsWith(">>", item.Overview, StringComparison.InvariantCulture); + Assert.EndsWith("<<", item.Overview, StringComparison.InvariantCulture); + } } } diff --git a/tests/Jellyfin.XbmcMetadata.Tests/Test Data/Lilo & Stitch.nfo b/tests/Jellyfin.XbmcMetadata.Tests/Test Data/Lilo & Stitch.nfo new file mode 100644 index 000000000..1eab687a2 --- /dev/null +++ b/tests/Jellyfin.XbmcMetadata.Tests/Test Data/Lilo & Stitch.nfo @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<movie> + <title>Lilo & Stitch</title> + <originaltitle>Lilo & Stitch</originaltitle> + <set>Lilo & Stitch Collection</set> + <plot>>>As Stitch, a runaway genetic experiment from a faraway planet, wreaks havoc on the Hawaiian Islands, he becomes the mischievous adopted alien "puppy" of an independent little girl named Lilo and learns about loyalty, friendship, and ʻohana, the Hawaiian tradition of family.<<</plot> +</movie> |
