Use JsonConverter

pull/4305/head
crobibero 4 years ago
parent 4558c192c7
commit fd9d325fa8

@ -662,11 +662,10 @@ namespace Jellyfin.Api.Controllers
}
}
var imageTypes = RequestHelpers.GetImageTypes(body.EnableImageTypes);
var dtoOptions = new DtoOptions()
.AddItemFields(body.Fields)
.AddClientFields(Request)
.AddAdditionalDtoOptions(body.EnableImages, body.EnableUserData, body.ImageTypeLimit, imageTypes);
.AddAdditionalDtoOptions(body.EnableImages, body.EnableUserData, body.ImageTypeLimit, body.EnableImageTypes);
return await _liveTvManager.GetPrograms(query, dtoOptions, CancellationToken.None).ConfigureAwait(false);
}

@ -1,4 +1,8 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
using MediaBrowser.Common.Json.Converters;
using MediaBrowser.Model.Entities;
namespace Jellyfin.Api.Models.LiveTvDtos
{
@ -137,7 +141,9 @@ namespace Jellyfin.Api.Models.LiveTvDtos
/// Gets or sets the image types to include in the output.
/// Optional.
/// </summary>
public string? EnableImageTypes { get; set; }
[JsonConverter(typeof(JsonCommaDelimitedArrayConverterFactory))]
[SuppressMessage("Microsoft.Performance", "CA1819:ReturnArrays", MessageId = "EnableImageTypes", Justification = "Imported from ServiceStack")]
public ImageType[] EnableImageTypes { get; set; } = Array.Empty<ImageType>();
/// <summary>
/// Gets or sets include user data.

Loading…
Cancel
Save