Esempio n. 1
0
        private async Task SaveIntoDatabase(AudioUploadDto uploadDto, CancellationToken ct)
        {
            var audioModel = new Audio
            {
                OwnerId        = uploadDto.PublisherId,
                Path           = uploadDto.Path,
                Meta           = _tagsProvider.GetTags(uploadDto.Path),
                UtcCreatedTime = _dateTimeWrapper.UtcNow
            };

            await _audioEntriesRepository.AddAsync(audioModel, ct);

            await _audioEntriesRepository.SaveAsync(ct);
        }
Esempio n. 2
0
 private async Task SaveToLocalFolder(AudioUploadDto uploadDto, CancellationToken ct)
 {
     await _localAudioRepository.AddAsync(uploadDto, ct);
 }
Esempio n. 3
0
 public async Task UploadAudioAsync(AudioUploadDto uploadDto, CancellationToken ct)
 {
     uploadDto.Path = _pathProvider.BuildPath(uploadDto.File.FileName);
     await SaveToLocalFolder(uploadDto, ct);
     await SaveIntoDatabase(uploadDto, ct);
 }