Response DTOs (ErsatzTV.Core/Api/MediaSources) and request DTOs (ErsatzTV/Controllers/Api/Requests) per the #202 design doc §B — the shared shapes that backend slices S1 (local libraries), S2 (Plex), and S3 (Jellyfin/Emby) will consume. No controllers or handler changes; DTOs are unused so far. Notable: RemoteConnectionResponseModel deliberately never carries the raw API key (secure connection contract); SaveRemoteConnectionRequest's To{Jellyfin,Emby}Command(existingApiKey) retains the existing key when the incoming ApiKey is blank/omitted. No conventions changed; nothing to update in docs/api-conventions.md.
17 lines
533 B
C#
17 lines
533 B
C#
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());
|
|
}
|