public override async Task <ScheduleDto> Update(UpdateScheduleInput input) { var currentChannel = await GetEntityByIdAsync(input.Id); if (!currentChannel.DoesNotChangeByInput( input.UploadIntervalOption, input.IntervalValue, input.OnExactDayTime) && currentChannel.Enable) { MapToEntity(input, currentChannel); _channelUploadScheduler.AddOrUpdate(currentChannel); } return(await base.Update(input)); }
public async Task Enable(EnableChannelInput input) { CheckUpdatePermission(); var channel = await GetEntityByIdAsync(input.Id); channel.Enable = input.Enable; if (channel.Enable) { _channelUploadScheduler.AddOrUpdate(channel); } else { _channelUploadScheduler.Disable(channel); } await CurrentUnitOfWork.SaveChangesAsync(); }