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