aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKGT1 <kilian.gamn@gmx.de>2025-10-08 15:32:30 +0000
committerKGT1 <kilian.gamn@gmx.de>2025-10-08 15:32:30 +0000
commite28d5470061960b5b3ed6e5ee6b89306ef429182 (patch)
tree5f13f3627423df292e3f5d891a8c639c1adf5617 /tests
parentb3b9f74014901f3a4a1f68c07e2ae3b29b12a585 (diff)
add test for new uniqueid nfo key normalisation
Diffstat (limited to 'tests')
-rw-r--r--tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs19
-rw-r--r--tests/Jellyfin.XbmcMetadata.Tests/Test Data/Lilo & Stitch.nfo1
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs b/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs
index e422eb9b8..1e8652f4b 100644
--- a/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs
+++ b/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs
@@ -275,5 +275,24 @@ namespace Jellyfin.XbmcMetadata.Tests.Parsers
Assert.StartsWith(">>", item.Overview, StringComparison.InvariantCulture);
Assert.EndsWith("<<", item.Overview, StringComparison.InvariantCulture);
}
+
+ [Fact]
+ public void Parse_TmdbcolUniqueId_NormalizedToTmdbCollection()
+ {
+ var result = new MetadataResult<Video>()
+ {
+ Item = new Movie()
+ };
+
+ _parser.Fetch(result, "Test Data/Lilo & Stitch.nfo", CancellationToken.None);
+ var item = (Movie)result.Item;
+
+ // Verify that <uniqueid type="tmdbcol"> is normalized to TmdbCollection
+ Assert.True(item.ProviderIds.ContainsKey(MetadataProvider.TmdbCollection.ToString()));
+ Assert.Equal("97020", item.ProviderIds[MetadataProvider.TmdbCollection.ToString()]);
+
+ // Verify that the lowercase "tmdbcol" is NOT in the provider IDs
+ Assert.False(item.ProviderIds.ContainsKey("tmdbcol"));
+ }
}
}
diff --git a/tests/Jellyfin.XbmcMetadata.Tests/Test Data/Lilo & Stitch.nfo b/tests/Jellyfin.XbmcMetadata.Tests/Test Data/Lilo & Stitch.nfo
index 1eab687a2..ca0be5dcc 100644
--- a/tests/Jellyfin.XbmcMetadata.Tests/Test Data/Lilo & Stitch.nfo
+++ b/tests/Jellyfin.XbmcMetadata.Tests/Test Data/Lilo & Stitch.nfo
@@ -2,6 +2,7 @@
<movie>
<title>Lilo &amp; Stitch</title>
<originaltitle>Lilo &amp; Stitch</originaltitle>
+ <uniqueid type="tmdbcol" default="false">97020</uniqueid>
<set>Lilo &amp; Stitch Collection</set>
<plot>&gt;&gt;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.&lt;&lt;</plot>
</movie>