private static MediaPublish EnqueuePublish(string accountId, string indexId) { TableClient tableClient = new TableClient(); string tableName = Constant.Storage.Table.InsightPublish; string partitionKey = accountId; string rowKey = indexId; MediaPublish insightPublish = tableClient.GetEntity <MediaPublish>(tableName, partitionKey, rowKey); if (insightPublish != null) { string settingKey = Constant.AppSettingKey.MediaPublishInsightQueue; string queueName = AppSetting.GetValue(settingKey); QueueClient queueClient = new QueueClient(); queueClient.AddMessage(queueName, insightPublish); } return(insightPublish); }
private static MediaPublish EnqueuePublish(MediaJobNotification jobNotification) { MediaPublish contentPublish = null; if (jobNotification.EventType == MediaJobNotificationEvent.JobStateChange && jobNotification.Properties.OldState == MediaJobState.Processing && jobNotification.Properties.NewState == MediaJobState.Finished) { TableClient tableClient = new TableClient(); string tableName = Constant.Storage.Table.ContentPublish; string partitionKey = jobNotification.Properties.AccountName; string rowKey = jobNotification.Properties.JobId; contentPublish = tableClient.GetEntity <MediaPublish>(tableName, partitionKey, rowKey); if (contentPublish != null) { string settingKey = Constant.AppSettingKey.MediaPublishContentQueue; string queueName = AppSetting.GetValue(settingKey); QueueClient queueClient = new QueueClient(); queueClient.AddMessage(queueName, contentPublish); } } return(contentPublish); }