Exemple #1
0
    public async Task <Option <TelevisionSeasonViewModel> > Handle(
        GetTelevisionSeasonById request,
        CancellationToken cancellationToken)
    {
        Option <JellyfinMediaSource> maybeJellyfin = await _mediaSourceRepository.GetAllJellyfin()
                                                     .Map(list => list.HeadOrNone());

        Option <EmbyMediaSource> maybeEmby = await _mediaSourceRepository.GetAllEmby()
                                             .Map(list => list.HeadOrNone());

        return(await _televisionRepository.GetSeason(request.SeasonId)
               .MapT(s => ProjectToViewModel(s, maybeJellyfin, maybeEmby)));
    }