Stream custom live channels using your own media
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.
 
 

18 lines
750 B

using ErsatzTV.Application.MediaItems;
using ErsatzTV.Core.Interfaces.Repositories;
using static ErsatzTV.Application.MediaItems.Mapper;
namespace ErsatzTV.Application.Television;
public class GetAllTelevisionShowsHandler : IRequestHandler<GetAllTelevisionShows, List<NamedMediaItemViewModel>>
{
private readonly ITelevisionRepository _televisionRepository;
public GetAllTelevisionShowsHandler(ITelevisionRepository televisionRepository) =>
_televisionRepository = televisionRepository;
public Task<List<NamedMediaItemViewModel>> Handle(
GetAllTelevisionShows request,
CancellationToken cancellationToken) =>
_televisionRepository.GetAllShows().Map(list => list.Map(ProjectToViewModel).ToList());
}