Ejemplo n.º 1
0
        public static string GetMediaProcessorName(MediaProcessor mediaProcessor)
        {
            string processorName = Regex.Replace(mediaProcessor.ToString(), Constants.CapitalSpacingExpression, Constants.CapitalSpacingReplacement);

            processorName = processorName.Replace("_", " ");
            return(processorName);
        }
Ejemplo n.º 2
0
        private static string UpsertDocument(DocumentClient documentClient, JObject document, MediaProcessor processor, IAsset asset, string fileName)
        {
            string documentId = string.Empty;

            if (ValidDocument(asset, fileName))
            {
                string collectionId = Constant.Database.Collection.ContentInsight;
                documentId        = documentClient.UpsertDocument(collectionId, document);
                asset.AlternateId = string.Concat(processor.ToString(), Constant.TextDelimiter.Identifier, documentId);
                asset.Update();
            }
            return(documentId);
        }
Ejemplo n.º 3
0
        public static NameValueCollection GetProcessorPresets(MediaProcessor mediaProcessor, string accountId)
        {
            NameValueCollection processorPresets = new NameValueCollection();
            DocumentClient      documentClient   = new DocumentClient();
            string collectionId    = Constant.Database.Collection.ProcessorConfig;
            string accountPresetId = string.Concat(accountId, Constant.TextDelimiter.Identifier, mediaProcessor.ToString());

            JObject[] presets = documentClient.GetDocuments(collectionId);
            foreach (JObject preset in presets)
            {
                string   presetId        = preset["id"].ToString();
                string   presetProcessor = preset["MediaProcessor"].ToString();
                string[] presetIdInfo    = presetId.Split(Constant.TextDelimiter.Identifier);
                bool     customPreset    = presetIdInfo.Length == 3 ? true : false;
                if ((!customPreset && presetProcessor.StartsWith(mediaProcessor.ToString(), StringComparison.OrdinalIgnoreCase)) ||
                    (customPreset && presetId.StartsWith(accountPresetId, StringComparison.Ordinal)))
                {
                    string presetName = preset["PresetName"].ToString();
                    processorPresets.Add(presetName, presetId);
                }
            }
            return(processorPresets);
        }
Ejemplo n.º 4
0
        public static string GetProcessorName(MediaProcessor mediaProcessor)
        {
            string processorName = mediaProcessor.ToString();

            return(Regex.Replace(processorName, Constant.TextFormatter.SpacePattern, Constant.TextFormatter.SpaceReplacement));
        }