mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
656 B
22 lines
656 B
using ErsatzTV.Core; |
|
using ErsatzTV.Core.Interfaces.Scheduling; |
|
|
|
namespace ErsatzTV.Application.Playouts; |
|
|
|
public class TimeShiftOnDemandPlayoutHandler(IPlayoutTimeShifter playoutTimeShifter) |
|
: IRequestHandler<TimeShiftOnDemandPlayout, Option<BaseError>> |
|
{ |
|
public async Task<Option<BaseError>> Handle(TimeShiftOnDemandPlayout request, CancellationToken cancellationToken) |
|
{ |
|
try |
|
{ |
|
await playoutTimeShifter.TimeShift(request.PlayoutId, request.Now, request.Force); |
|
} |
|
catch (Exception ex) |
|
{ |
|
return BaseError.New(ex.Message); |
|
} |
|
|
|
return Option<BaseError>.None; |
|
} |
|
}
|
|
|