Puush constructor with api key

This commit is contained in:
Jaex 2016-06-28 19:36:24 +03:00
parent 15e1608e71
commit 3462b999ef

View file

@ -44,10 +44,7 @@ public override bool CheckConfig(UploadersConfig config)
public override GenericUploader CreateUploader(UploadersConfig config, TaskReferenceHelper taskInfo)
{
return new Puush()
{
APIKey = config.PuushAPIKey
};
return new Puush(config.PuushAPIKey);
}
public override TabPage GetUploadersConfigTabPage(UploadersConfigForm form) => form.tpPuush;
@ -56,14 +53,24 @@ public override GenericUploader CreateUploader(UploadersConfig config, TaskRefer
public class Puush : FileUploader
{
public const string PuushURL = "https://puush.me";
public const string PuushAPIURL = PuushURL + "/api";
public const string PuushAPILoginURL = PuushAPIURL + "/auth";
public const string PuushAPIUploadURL = PuushAPIURL + "/up";
public const string PuushRegisterURL = PuushURL + "/register";
public const string PuushResetPasswordURL = PuushURL + "/reset_password";
private const string PuushAPIURL = PuushURL + "/api";
private const string PuushAPILoginURL = PuushAPIURL + "/auth";
private const string PuushAPIUploadURL = PuushAPIURL + "/up";
public string APIKey { get; set; }
public Puush()
{
}
public Puush(string apiKey)
{
APIKey = apiKey;
}
public string Login(string email, string password)
{
Dictionary<string, string> arguments = new Dictionary<string, string>();