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.
21 lines
772 B
21 lines
772 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 GetChannelPlaylistHandler : IRequestHandler<GetChannelPlaylist, ChannelPlaylist> |
|
{ |
|
private readonly IChannelRepository _channelRepository; |
|
|
|
public GetChannelPlaylistHandler(IChannelRepository channelRepository) => |
|
_channelRepository = channelRepository; |
|
|
|
public Task<ChannelPlaylist> Handle(GetChannelPlaylist request, CancellationToken cancellationToken) => |
|
_channelRepository.GetAll() |
|
.Map(channels => new ChannelPlaylist(request.Scheme, request.Host, channels)); |
|
} |
|
}
|
|
|