mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-22 05:30:46 +02:00
Use JsonConverter
This commit is contained in:
parent
4558c192c7
commit
fd9d325fa8
|
@ -662,11 +662,10 @@ namespace Jellyfin.Api.Controllers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var imageTypes = RequestHelpers.GetImageTypes(body.EnableImageTypes);
|
|
||||||
var dtoOptions = new DtoOptions()
|
var dtoOptions = new DtoOptions()
|
||||||
.AddItemFields(body.Fields)
|
.AddItemFields(body.Fields)
|
||||||
.AddClientFields(Request)
|
.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);
|
return await _liveTvManager.GetPrograms(query, dtoOptions, CancellationToken.None).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
using System;
|
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
|
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.
|
/// Gets or sets the image types to include in the output.
|
||||||
/// Optional.
|
/// Optional.
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// Gets or sets include user data.
|
/// Gets or sets include user data.
|
||||||
|
|
Loading…
Reference in a new issue