private void DoMenuIndexAssets() { List<IAsset> SelectedAssets = ReturnSelectedAssets(); if (SelectedAssets.Count == 0) { MessageBox.Show("No asset was selected"); return; } if (SelectedAssets.FirstOrDefault() == null) return; var proposedfiles = CheckSingleFileIndexerSupportedExtensions(SelectedAssets); // Get the SDK extension method to get a reference to the Azure Media Indexer. IMediaProcessor processor = GetLatestMediaProcessorByName(Constants.AzureMediaIndexer); Indexer form = new Indexer(_context, processor.Version) { IndexerJobName = "Media Indexing of " + Constants.NameconvInputasset, IndexerOutputAssetName = Constants.NameconvInputasset + " - Indexed", IndexerInputAssetName = (SelectedAssets.Count > 1) ? SelectedAssets.Count + " assets have been selected for media indexing." : "Asset '" + SelectedAssets.FirstOrDefault().Name + "' will be indexed.", }; string taskname = "Media Indexing of " + Constants.NameconvInputasset; if (form.ShowDialog() == DialogResult.OK) { var ListConfig = new List<string>(); foreach (var asset in SelectedAssets) { ListConfig.Add( Indexer.LoadAndUpdateIndexerConfiguration( Path.Combine(_configurationXMLFiles, @"MediaIndexer.xml"), form.IndexerTitle, form.IndexerDescription, form.IndexerLanguage, form.IndexerGenerationOptions, proposedfiles.ContainsKey(asset.Id) ? proposedfiles[asset.Id] : null ) ); } LaunchJobs_OneJobPerInputAssetWithSpecificConfig( processor, SelectedAssets, form.IndexerJobName, form.JobOptions.Priority, taskname, form.IndexerOutputAssetName, ListConfig, form.JobOptions.OutputAssetsCreationOptions, form.JobOptions.TasksOptionsSetting, form.JobOptions.StorageSelected ); } }
private void DoMenuIndexAssets() { List<IAsset> SelectedAssets = ReturnSelectedAssets(); if (SelectedAssets.Count == 0) { MessageBox.Show("No asset was selected"); return; } if (SelectedAssets.FirstOrDefault() == null) return; // Get the SDK extension method to get a reference to the Azure Media Indexer. IMediaProcessor processor = GetLatestMediaProcessorByName(Constants.AzureMediaIndexer); Indexer form = new Indexer(_context) { IndexerJobName = "Media Indexing of " + Constants.NameconvInputasset, IndexerOutputAssetName = Constants.NameconvInputasset + " - Indexed", IndexerProcessorName = "Processor: " + processor.Vendor + " / " + processor.Name + " v" + processor.Version, IndexerInputAssetName = (SelectedAssets.Count > 1) ? SelectedAssets.Count + " assets have been selected for media indexing." : "Asset '" + SelectedAssets.FirstOrDefault().Name + "' will be indexed.", }; string taskname = "Media Indexing of " + Constants.NameconvInputasset; if (form.ShowDialog() == DialogResult.OK) { string configIndexer = Indexer.LoadAndUpdateIndexerConfiguration( Path.Combine(_configurationXMLFiles, @"MediaIndexer.xml"), form.IndexerTitle, form.IndexerDescription, form.IndexerLanguage, form.IndexerGenerationOptions ); LaunchJobs(processor, SelectedAssets, form.IndexerJobName, form.JobOptions.Priority, taskname, form.IndexerOutputAssetName, new List<string> { configIndexer }, form.JobOptions.OutputAssetsCreationOptions, form.JobOptions.TasksOptionsSetting, form.JobOptions.StorageSelected ); } }