public async Task <Option <TelevisionShowViewModel> > Handle( GetTelevisionShowById request, CancellationToken cancellationToken) { Option <Show> maybeShow = await _televisionRepository.GetShow(request.Id); return(await maybeShow.Match <Task <Option <TelevisionShowViewModel> > >( async show => { Option <JellyfinMediaSource> maybeJellyfin = await _mediaSourceRepository.GetAllJellyfin() .Map(list => list.HeadOrNone()); Option <EmbyMediaSource> maybeEmby = await _mediaSourceRepository.GetAllEmby() .Map(list => list.HeadOrNone()); List <string> mediaCodes = await _searchRepository.GetLanguagesForShow(show); List <string> languageCodes = await _searchRepository.GetAllLanguageCodes(mediaCodes); return ProjectToViewModel(show, languageCodes, maybeJellyfin, maybeEmby); }, () => Task.FromResult(Option <TelevisionShowViewModel> .None))); }