mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
617 B
15 lines
617 B
using ErsatzTV.Core.Interfaces.Repositories; |
|
using ErsatzTV.Core.Iptv; |
|
|
|
namespace ErsatzTV.Application.Channels; |
|
|
|
public class GetChannelGuideHandler : IRequestHandler<GetChannelGuide, ChannelGuide> |
|
{ |
|
private readonly IChannelRepository _channelRepository; |
|
|
|
public GetChannelGuideHandler(IChannelRepository channelRepository) => _channelRepository = channelRepository; |
|
|
|
public Task<ChannelGuide> Handle(GetChannelGuide request, CancellationToken cancellationToken) => |
|
_channelRepository.GetAllForGuide() |
|
.Map(channels => new ChannelGuide(request.Scheme, request.Host, channels)); |
|
}
|
|
|