示例#1
0
        public static MediaJobInput[] GetJobInputs(string authToken, MediaClient mediaClient, string storageAccount, bool storageEncryption,
                                                   string inputAssetName, bool multipleFileAsset, string[] fileNames)
        {
            List <MediaJobInput> jobInputs = new List <MediaJobInput>();

            if (multipleFileAsset)
            {
                IAsset        asset    = mediaClient.CreateAsset(authToken, inputAssetName, storageAccount, storageEncryption, fileNames);
                MediaJobInput jobInput = GetJobInput(asset);
                jobInputs.Add(jobInput);
            }
            else
            {
                foreach (string fileName in fileNames)
                {
                    string assetName = fileName;
                    if (fileNames.Length == 1 && !string.IsNullOrEmpty(inputAssetName))
                    {
                        assetName = inputAssetName;
                    }
                    IAsset        asset    = mediaClient.CreateAsset(authToken, assetName, storageAccount, storageEncryption, new string[] { fileName });
                    MediaJobInput jobInput = GetJobInput(asset);
                    jobInputs.Add(jobInput);
                }
            }
            return(jobInputs.ToArray());
        }
示例#2
0
        private static MediaJobInput GetJobInput(IAsset asset)
        {
            MediaJobInput jobInput = new MediaJobInput()
            {
                AssetId     = asset.Id,
                AssetName   = asset.Name,
                PrimaryFile = MediaClient.GetPrimaryFile(asset)
            };

            return(jobInput);
        }
示例#3
0
        private static int OrderByWorkflow(MediaJobInput leftItem, MediaJobInput rightIten)
        {
            int comparison = 0;

            if (IsPremiumWorkflow(leftItem))
            {
                comparison = -1;
            }
            else if (IsPremiumWorkflow(rightIten))
            {
                comparison = 1;
            }
            return(comparison);
        }
示例#4
0
        public static MediaJobInput[] GetJobInputs(MediaClient mediaClient, string[] assetIds)
        {
            List <MediaJobInput> jobInputs = new List <MediaJobInput>();

            foreach (string assetId in assetIds)
            {
                IAsset asset = mediaClient.GetEntityById(MediaEntity.Asset, assetId) as IAsset;
                if (asset != null)
                {
                    MediaJobInput jobInput = GetJobInput(asset);
                    jobInputs.Add(jobInput);
                }
            }
            return(jobInputs.ToArray());
        }
示例#5
0
 private static bool IsPremiumWorkflow(MediaJobInput jobInput)
 {
     return(jobInput.PrimaryFile.EndsWith(Constant.Media.FileExtension.Workflow, StringComparison.OrdinalIgnoreCase));
 }