jellyfin/Jellyfin.Api/Models/PlaylistDtos/CreatePlaylistDto.cs
Bond-009 2db0750abb
Make the JsonConverters for delimited arrays more generic (#13396)
* Make the JsonConverters for delimited arrays more generic

Also adds some tests for serialization (with different types) as we didn't have any before.

* Ignore warnings
2025-02-13 20:24:55 -07:00

46 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
using Jellyfin.Data.Enums;
using Jellyfin.Extensions.Json.Converters;
using MediaBrowser.Model.Entities;
namespace Jellyfin.Api.Models.PlaylistDtos;
/// <summary>
/// Create new playlist dto.
/// </summary>
public class CreatePlaylistDto
{
/// <summary>
/// Gets or sets the name of the new playlist.
/// </summary>
public required string Name { get; set; }
/// <summary>
/// Gets or sets item ids to add to the playlist.
/// </summary>
[JsonConverter(typeof(JsonCommaDelimitedCollectionConverterFactory))]
public IReadOnlyList<Guid> Ids { get; set; } = [];
/// <summary>
/// Gets or sets the user id.
/// </summary>
public Guid? UserId { get; set; }
/// <summary>
/// Gets or sets the media type.
/// </summary>
public MediaType? MediaType { get; set; }
/// <summary>
/// Gets or sets the playlist users.
/// </summary>
public IReadOnlyList<PlaylistUserPermissions> Users { get; set; } = [];
/// <summary>
/// Gets or sets a value indicating whether the playlist is public.
/// </summary>
public bool IsPublic { get; set; } = true;
}