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.
20 lines
747 B
20 lines
747 B
using System.Threading; |
|
using System.Threading.Tasks; |
|
using ErsatzTV.Core.Interfaces.Repositories; |
|
using ErsatzTV.Core.Iptv; |
|
using LanguageExt; |
|
using MediatR; |
|
|
|
namespace ErsatzTV.Application.Channels.Queries |
|
{ |
|
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)); |
|
} |
|
}
|
|
|