public UploadImageCommand(ImageFileRepository imageFileRepository, AssetDocumentRepository assetDocumentRepository, UploadAssetNotifier notifier) : base(notifier) { _assetRootPath = ConfigurationManager.AppSettings["ImageRootPath"]; _imageFileRepository = imageFileRepository; _assetDocumentRepository = assetDocumentRepository; }
private static void UploadAsset(FileMetadata file) { var assetFileRepository = new ImageFileRepository(); var assetDocumentRepository = new AssetDocumentRepository(); var notifier = new MessageBusClient(); var assetRootPath = ConfigurationManager.AppSettings["ImageRootPath"]; var id = Guid.NewGuid().ToString(); var fileInfo = FileReader.GetFileInfo(file.FileLocation); var fileContents = FileReader.ReadFile(file.FileLocation); var fileName = $"original{fileInfo.Extension}"; var storageMetadata = assetFileRepository.StoreAsset(id, fileName, "image/jpeg", fileContents); if (storageMetadata == null) { return; } var imageMetadata = FileReader.GetImageMetadata(file.FileName); var imageDescription = imageMetadata.GetValue("Exif IFD0", "Image Description"); var assetMetadata = new AssetMetadata { Id = id, Name = file.FileName, Description = imageDescription ?? string.Empty, Category = file.Category, ContentType = "image/jpeg", Author = file.Photographer, Url = $"{assetRootPath}/{storageMetadata.StorageId}", StorageMetadata = storageMetadata, Type = "image" }; assetDocumentRepository.Create(assetMetadata); notifier.SendMessage(new NewImageAdded { ImageName = storageMetadata.StorageId, Id = id }); }
public GenerateThumbnail(ImageFileRepository fileRepository, AssetDocumentRepository documentRepository) { _fileRepository = fileRepository; _documentRepository = documentRepository; }
public EncodeSmoothStreamingVideo(MediaServicesRepository mediaServicesRepository, AssetDocumentRepository documentRepository, MessageBusClient messageBusClient) { _mediaServicesRepository = mediaServicesRepository; _documentRepository = documentRepository; _messageBusClient = messageBusClient; }
public ExtractVideoKeywords(MediaServicesRepository mediaServicesRepository, AssetDocumentRepository documentRepository, MessageBusClient messageBusClient) { _mediaServicesRepository = mediaServicesRepository; _documentRepository = documentRepository; _messageBusClient = messageBusClient; }
public AssetDocumentCDNDecorator(AssetDocumentRepository repository) { _repository = repository; }
public UploadVideoCommand(MediaServicesRepository mediaServicesRepository, AssetDocumentRepository assetDocumentRepository, UploadAssetNotifier notifier) : base(notifier) { _mediaServicesRepository = mediaServicesRepository; _assetDocumentRepository = assetDocumentRepository; }
public UpdateSearchAssetSearchRecord(AssetDocumentRepository docuementRepository, SearchManagementClient _searchClient) { _docuementRepository = docuementRepository; this._searchClient = _searchClient; }
public GetAssetDetailsQuery(AssetDocumentRepository assetdocumentRepository) { _assetDocumentRepository = assetdocumentRepository; }