Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (push) Has been skipped
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (push) Has been skipped
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (push) Successful in 15m30s
Build ErsatzTV Image / Functional E2E (curl contracts) (push) Successful in 15m48s
Build ErsatzTV Image / Build & test (.NET) (push) Successful in 7m32s
Build ErsatzTV Image / Build & push image (amd64) (push) Has been cancelled
Closes #415. Server-derived health object on the channel list + detail DTOs (built-timeline detection, kind-agnostic across all 5 PlayoutScheduleKind; assessable gate keyed to the owning channel's mode), single "Problems" SPA filter with per-fault badges. Supersedes #72's api.channel-health-signal decision. Co-authored-by: Timothy <timothy.look@gmail.com> Co-committed-by: Timothy <timothy.look@gmail.com>
59 lines
2.4 KiB
C#
59 lines
2.4 KiB
C#
#nullable enable
|
|
using ErsatzTV.Core.Domain;
|
|
|
|
namespace ErsatzTV.Core.Api.Channels;
|
|
|
|
// Faithful channel-detail DTO for the SPA channel editor (GET/POST/PUT /api/v1/channels[/{id}]).
|
|
// Exposes the raw editable field set the editor reads (raw FFmpegProfileId / WatermarkId /
|
|
// FallbackFillerId ids and the mode enums), unlike the lean list ChannelResponseModel which
|
|
// resolves the profile to a display name and drops the editable ids. Mirrors the effective
|
|
// nullability of the (now-removed-from-the-schema) ChannelViewModel so the SPA form logic is
|
|
// unaffected. WebEncodedName is intentionally dropped: the SPA never reads it.
|
|
public record ChannelDetailResponseModel(
|
|
int Id,
|
|
string Number,
|
|
string Name,
|
|
string Group,
|
|
string Categories,
|
|
int FFmpegProfileId,
|
|
double? SlugSeconds,
|
|
ChannelLogoResponseModel Logo,
|
|
ChannelStreamSelectorMode StreamSelectorMode,
|
|
string StreamSelector,
|
|
string PreferredAudioLanguageCode,
|
|
string PreferredAudioTitle,
|
|
ChannelPlayoutSource PlayoutSource,
|
|
ChannelPlayoutMode PlayoutMode,
|
|
int? MirrorSourceChannelId,
|
|
TimeSpan? PlayoutOffset,
|
|
StreamingMode StreamingMode,
|
|
int? WatermarkId,
|
|
int? FallbackFillerId,
|
|
int PlayoutCount,
|
|
string PreferredSubtitleLanguageCode,
|
|
ChannelSubtitleMode SubtitleMode,
|
|
ChannelMusicVideoCreditsMode MusicVideoCreditsMode,
|
|
string MusicVideoCreditsTemplate,
|
|
ChannelSongVideoMode SongVideoMode,
|
|
ChannelTranscodeMode TranscodeMode,
|
|
ChannelIdleBehavior IdleBehavior,
|
|
bool IsEnabled,
|
|
bool ShowInEpg,
|
|
int[] GraphicsElementIds,
|
|
// Server-derived health rollup (api.channel-health-object). See ChannelHealthResponseModel.
|
|
ChannelHealthResponseModel Health);
|
|
|
|
// Wire-compatible mirror of the Application-layer ArtworkContentTypeModel (which lives in
|
|
// ErsatzTV.Application and therefore can't be referenced from Core). Same serialized shape the
|
|
// SPA's UpdateChannelRequest.logo already expects, so draftFromChannel's round-trip is lossless.
|
|
public record ChannelLogoResponseModel(string Path, string ContentType)
|
|
{
|
|
public bool IsExternalUrl => Domain.Artwork.IsExternalUrl(Path);
|
|
|
|
public bool HasContentType => !string.IsNullOrWhiteSpace(ContentType);
|
|
|
|
// The artwork serve routes sniff the content type from the stored file and no longer honor a
|
|
// client-supplied ?contentType= (issue #283), so the directly-usable URL is just the path.
|
|
public string UrlWithContentType => Path;
|
|
}
|