Build ErsatzTV Image / CI image pin matches docker/ci (pull_request) Successful in 5s
Build ErsatzTV Image / Docs update reminder (pull_request) Successful in 4s
Build ErsatzTV Image / decisions.md append-only (pull_request) Successful in 5s
Build ErsatzTV Image / Functional E2E (curl contracts) (pull_request) Successful in 5m11s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 4m49s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 14m47s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 18m36s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 36m51s
CI's "Formatting (changed .cs conform to .editorconfig)" job failed with `error CHARSET: Fix file encoding` on all six pre-existing BOM'd files this PR touches. The #311 gate is fix-as-you-touch: any .cs a PR touches must conform to .editorconfig (charset=utf-8), and these carried BOMs inherited from upstream. BOM removal only — six files, one line each, zero content change. The three files already without a BOM (GetChannelByIdForApiHandler + both new/changed Tests files) needed nothing. Note for the next person: this cannot be validated locally on this Mac — `dotnet format --include` silently no-ops here, so the gate is only observable in CI. Check `head -c3 <file> | xxd -p` for `efbbbf` on every touched .cs before pushing instead of trusting a local format run. Refs #72
15 lines
640 B
C#
15 lines
640 B
C#
using ErsatzTV.Core.Domain;
|
|
using ErsatzTV.Core.Interfaces.Repositories;
|
|
using static ErsatzTV.Application.Channels.Mapper;
|
|
|
|
namespace ErsatzTV.Application.Channels;
|
|
|
|
public class GetAllChannelsHandler(IChannelRepository channelRepository)
|
|
: IRequestHandler<GetAllChannels, List<ChannelViewModel>>
|
|
{
|
|
public async Task<List<ChannelViewModel>> Handle(GetAllChannels request, CancellationToken cancellationToken) =>
|
|
await channelRepository.GetAll(cancellationToken)
|
|
.Map(list => list.Where(c => c.IsEnabled || request.ShowDisabled)
|
|
.Map(c => ProjectToViewModel(c, GetPlayoutsCount(c))).ToList());
|
|
}
|