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.
 
 

19 lines
764 B

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