Skip to content

Latest commit

 

History

History
102 lines (70 loc) · 2.52 KB

README.md

File metadata and controls

102 lines (70 loc) · 2.52 KB

This fork is designed with MediaCrush-Windows in mind, and is not suitable for general-purpose use. Use the original repository if you intend to make MediaCrush-enabled apps with .NET.

SharpCrush

A .NET Wrapper for the media crush API: https://mediacru.sh/docs/API
MediaCrush source repo is found here

Contributing

...

Example Usage

Retrieving file info

MediaCrush API Implementation: https://github.com/MediaCrush/MediaCrush/blob/master/docs/api.md#apihash

  var fileInfo = SharpCrush.GetFileInfo("tVWMM_ziA3nm");

Retrieving info about multiple files

MediaCrush API Implementation: https://github.com/MediaCrush/MediaCrush/blob/master/docs/api.md#apiinfolisthash

  var fileInfos = SharpCrush.GetFileInfo("tVWMM_ziA3nm", "CPvuR5lRhmS0", "tVWMM_ziA3nm", "CPvuR5lRhmS0", ... );

or

  var fileInfos = SharpCrush.GetFileInfo(new string[] {"tVWMM_ziA3nm", "CPvuR5lRhmS0", "tVWMM_ziA3nm", ...} );

Checking for file existance

MediaCrush API Implementation: https://github.com/MediaCrush/MediaCrush/blob/master/docs/api.md#apihashexists

  var fileExists = SharpCrush.GetFileExists("tVWMM_ziA3nm");
  
  if(fileExists) 
  {
    // ...
  }
  

Deleting files

MediaCrush API Implementation: https://github.com/MediaCrush/MediaCrush/blob/master/docs/api.md#apihashdelete

  var deleteFileResult = SharpCrush.DeleteFile("tVWMM_ziA3nm");
  
  if(deleteFileResult == DeleteFileResult.Successful)
  {
    // ...
  }
  

Retrieving file upload status

MediaCrush API Implementation: https://github.com/MediaCrush/MediaCrush/blob/master/docs/api.md#apihashstatus

  var fileStatusResult = SharpCrush.GetFileStatus("tVWMM_ziA3nm");
  
  if(fileStatusResult == GetFileStatusResult.Successful)
  {
    // ...
  }
  

Uploading files

MediaCrush API Implementation: https://github.com/MediaCrush/MediaCrush/blob/master/docs/api.md#apiuploadfile

  var fileUploadResult = SharpCrush.UploadFile(fileToUploadGoesHere);
  
  if(fileStatusResult == FileUploadResult.Successful)
  {
    // ...
  }
  

Uploading URLs

MediaCrush API Implementation: https://github.com/MediaCrush/MediaCrush/blob/master/docs/api.md#apiuploadurl

  var fileStatusResult = SharpCrush.UploadUrl("http://example.com/reallyslowimages/img.gif");
  
  if(fileStatusResult == UrlUploadResult.Successful)
  {
    // ...
  }
  

NOTE: These will probably change as I find myself hating my code more and more