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.
30 lines
1.0 KiB
C#
30 lines
1.0 KiB
C#
using ErsatzTV.Application.Emby;
|
|
using ErsatzTV.Application.Jellyfin;
|
|
using ErsatzTV.Application.Plex;
|
|
|
|
namespace ErsatzTV.Controllers.Api.Requests;
|
|
|
|
public record ReplacePathReplacementsRequest(List<PathReplacementItemRequest> Items)
|
|
{
|
|
public UpdatePlexPathReplacements ToPlexCommand(int sourceId) =>
|
|
new(
|
|
sourceId,
|
|
(Items ?? [])
|
|
.Select(item => new PlexPathReplacementItem(item.Id, item.RemotePath, item.LocalPath))
|
|
.ToList());
|
|
|
|
public UpdateJellyfinPathReplacements ToJellyfinCommand(int sourceId) =>
|
|
new(
|
|
sourceId,
|
|
(Items ?? [])
|
|
.Select(item => new JellyfinPathReplacementItem(item.Id, item.RemotePath, item.LocalPath))
|
|
.ToList());
|
|
|
|
public UpdateEmbyPathReplacements ToEmbyCommand(int sourceId) =>
|
|
new(
|
|
sourceId,
|
|
(Items ?? [])
|
|
.Select(item => new EmbyPathReplacementItem(item.Id, item.RemotePath, item.LocalPath))
|
|
.ToList());
|
|
}
|