using ErsatzTV.Application.Libraries;

namespace ErsatzTV.Controllers.Api.Requests;

// MediaKind is immutable after create, so it is deliberately absent here (structural immutability
// instead of a 422 — see design #202 §C3).
public record UpdateLocalLibraryRequest(string Name, List<UpdateLocalLibraryPathRequest> Paths)
{
    public UpdateLocalLibrary ToCommand(int id) =>
        new(
            id,
            Name,
            (Paths ?? [])
                .Select(path => path.ToCommand())
                .ToList());
}
