add test for new uniqueid nfo key normalisation

This commit is contained in:
KGT1 2025-10-08 15:32:30 +00:00
parent b3b9f74014
commit e28d547006
2 changed files with 20 additions and 0 deletions

View file

@ -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"));
}
}
}

View file

@ -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>