Exemple #1
0
    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())));
    }
Exemple #2
0
 private async Task <Validation <BaseError, RequestParameters> > Validate(GetLastPtsDuration request) =>
 await ValidateFFprobePath().MapT(ffprobePath => new RequestParameters(request.ChannelNumber, ffprobePath));