public FileResult Create(string name, string mediaPath, int width, int height, bool force = false) { IStorageFile thumbnailFile = _thumbnailsService.CreateThumbnail(mediaPath, name, width, height, force); if (thumbnailFile != null) { return(File(thumbnailFile.OpenRead(), thumbnailFile.GetFileType())); } return(File(Encoding.UTF8.GetBytes("Invalid media"), "text/plain")); }
private MediaFile BuildMediaFile(string relativePath, IStorageFile file) { return(new MediaFile { Name = file.GetName(), Size = file.GetSize(), LastUpdated = file.GetLastUpdated(), Type = file.GetFileType(), FolderName = relativePath, MediaPath = GetMediaPublicUrl(relativePath, file.GetName()) }); }
private MediaFile BuildMediaFile(string relativePath, IStorageFile file) { return new MediaFile { Name = file.GetName(), Size = file.GetSize(), LastUpdated = file.GetLastUpdated(), Type = file.GetFileType(), FolderName = relativePath, MediaPath = GetMediaPublicUrl(relativePath, file.GetName()) }; }