Backport pull request #12949 from jellyfin/release-10.10.z

Fix json array string writer in JsonDelimitedArrayConverter

Original-merge: 3089e9e40a

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
gnattu 2024-11-19 15:43:20 -05:00 committed by Joshua M. Boniface
parent 4f562d67b0
commit 19c5c95f4e

View File

@ -70,24 +70,11 @@ namespace Jellyfin.Extensions.Json.Converters
writer.WriteStartArray();
if (value.Length > 0)
{
var toWrite = value.Length - 1;
foreach (var it in value)
{
var wrote = false;
if (it is not null)
{
writer.WriteStringValue(it.ToString());
wrote = true;
}
if (toWrite > 0)
{
if (wrote)
{
writer.WriteStringValue(Delimiter.ToString());
}
toWrite--;
}
}
}