mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 01:34:45 +03:00
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:
committed by
Joshua M. Boniface
parent
4f562d67b0
commit
19c5c95f4e
@@ -70,24 +70,11 @@ namespace Jellyfin.Extensions.Json.Converters
|
|||||||
writer.WriteStartArray();
|
writer.WriteStartArray();
|
||||||
if (value.Length > 0)
|
if (value.Length > 0)
|
||||||
{
|
{
|
||||||
var toWrite = value.Length - 1;
|
|
||||||
foreach (var it in value)
|
foreach (var it in value)
|
||||||
{
|
{
|
||||||
var wrote = false;
|
|
||||||
if (it is not null)
|
if (it is not null)
|
||||||
{
|
{
|
||||||
writer.WriteStringValue(it.ToString());
|
writer.WriteStringValue(it.ToString());
|
||||||
wrote = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (toWrite > 0)
|
|
||||||
{
|
|
||||||
if (wrote)
|
|
||||||
{
|
|
||||||
writer.WriteStringValue(Delimiter.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
toWrite--;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user