public async Task <Either <BaseError, PtsAndDuration> > Handle( GetLastPtsDuration request, CancellationToken cancellationToken) { Validation <BaseError, RequestParameters> validation = await Validate(request); return(await validation.Match( parameters => Handle(parameters, cancellationToken), error => Task.FromResult <Either <BaseError, PtsAndDuration> >(error.Join()))); }
private async Task <Validation <BaseError, RequestParameters> > Validate(GetLastPtsDuration request) => await ValidateFFprobePath().MapT(ffprobePath => new RequestParameters(request.ChannelNumber, ffprobePath));