protected override async Task Handle(UploadFileCommand command, CancellationToken cancellationToken) { var validationRequest = new PlaylistAccessibilityValidationRequest() { PlaylistId = command.PlaylistId, UserId = command.UserId }; var result = await _mediator.Send(validationRequest, cancellationToken); if (!result.IsValid) { throw new ValidationException(result.InvalidityReason); } var fileName = $"{command.UserId}__{Guid.NewGuid()}"; await _audioStorage.UploadUnprocessedAudioFileAsync(fileName, command.File); var audioConversionMessage = new AudioConversionMessage { FileName = fileName, AdditionalData = new AudioUploadingAdditionalData { UserId = command.UserId, PlaylistId = command.PlaylistId, TrackName = command.Name } }; await _audioUploadingMessageBroker.SendAudioConversionRequest(audioConversionMessage); }
public async Task SendAudioConversionRequest(AudioConversionMessage audioConversionMessage) { await SendMessage(_serviceBusConfig.AudioConversionQueueName, audioConversionMessage); }