Beispiel #1
0
        public async Task <IActionResult> Post()
        {
            ITasksProcessorActor tasksWorkflow = _client.GetGrain <ITasksProcessorActor>(Guid.Empty);
            await tasksWorkflow.QualityCheck(@"D:\Pics\VIDEO0002.mp4");

            throw new NotImplementedException();
        }
Beispiel #2
0
        public async Task <IActionResult> PostQC(Guid id, [FromBody] MetadataTaskBizModel value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(new ErrorResponse()
                                  .AddModelStateErrors(ModelState)));
            }

            VFileSystemItem file = _mockData[0]; //await _fileService.Get(_principal, id); //

            //value.Id = await _taskService.Create(_principal,
            //        _mapper.Map<TaskModel>(value), id);

            ITasksProcessorActor tasksProcessor = _orleansClient.GetGrain <ITasksProcessorActor>(Guid.Empty);

            //bool succeeded = await tasksProcessor.ScheduleTranscode(file.Location, transcoded + "." + value.Format, value.Format);
            await tasksProcessor.ScheduleQualityControl(file.Location);

            return(CreatedAtAction(nameof(GetFileById), new { id = value.Id }, value));
        }
Beispiel #3
0
        public async Task <IActionResult> PostTranscoder(Guid id, [FromBody] TranscoderTaskBizModel value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(new ErrorResponse()
                                  .AddModelStateErrors(ModelState)));
            }

            VFileSystemItem file     = _mockData[0]; //await _fileService.Get(_principal, id); //
            string          location = ConfigUtils.ConfigurationProvider
                                       .GetDefaultConfig()
                                       .GetSection("Storage").GetValue <string>("TranscoderLocation");
            //value.Id = await _taskService.Create(_principal,
            //        _mapper.Map<TaskModel>(value), id);

            ITasksProcessorActor tasksProcessor = _orleansClient.GetGrain <ITasksProcessorActor>(Guid.Empty);

            string transcoded = Path.Combine(location, file.Id.ToString());

            bool succeeded = await tasksProcessor.ScheduleTranscode(file.Location, transcoded + "." + value.Format, value.Format);

            return(CreatedAtAction(nameof(GetFileById), new { id = value.Id }, value));
        }