Adds Compatibility button for ownCloud versions 8.1+ to fix #784

This commit is contained in:
Daniel McAssey 2015-07-21 22:52:00 +01:00
parent 585da60da7
commit 1be901dd08
6 changed files with 2964 additions and 3203 deletions

View file

@ -41,6 +41,7 @@ public sealed class OwnCloud : FileUploader
public bool CreateShare { get; set; }
public bool DirectLink { get; set; }
public bool IgnoreInvalidCert { get; set; }
public bool IsCompatibility81 { get; set; }
public OwnCloud(string host, string username, string password)
{
@ -133,7 +134,7 @@ public string ShareFile(string path)
if (result.ocs.data != null && result.ocs.meta.statuscode == 100)
{
string link = result.ocs.data.url;
if (DirectLink) link += "&download";
if (DirectLink) link += (IsCompatibility81 ? "/download" : "&download");
return link;
}
else

View file

@ -132,6 +132,9 @@ private void InitializeComponent()
this.tpLnkU = new System.Windows.Forms.TabPage();
this.txtLnkUAPIKEY = new System.Windows.Forms.TextBox();
this.lblLnkUAPIKey = new System.Windows.Forms.Label();
this.tpCoinURL = new System.Windows.Forms.TabPage();
this.txtCoinURLUUID = new System.Windows.Forms.TextBox();
this.lblCoinURLUUID = new System.Windows.Forms.Label();
this.tpFileUploaders = new System.Windows.Forms.TabPage();
this.tcFileUploaders = new System.Windows.Forms.TabControl();
this.tpFTP = new System.Windows.Forms.TabPage();
@ -436,9 +439,7 @@ private void InitializeComponent()
this.lblWidthHint = new System.Windows.Forms.Label();
this.ttlvMain = new ShareX.HelpersLib.TabToListView();
this.actRapidShareAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.tpCoinURL = new System.Windows.Forms.TabPage();
this.txtCoinURLUUID = new System.Windows.Forms.TextBox();
this.lblCoinURLUUID = new System.Windows.Forms.Label();
this.cbOwnCloud81Compatibility = new System.Windows.Forms.CheckBox();
this.tpOtherUploaders.SuspendLayout();
this.tcOtherUploaders.SuspendLayout();
this.tpTwitter.SuspendLayout();
@ -453,6 +454,7 @@ private void InitializeComponent()
this.tpYourls.SuspendLayout();
this.tpAdFly.SuspendLayout();
this.tpLnkU.SuspendLayout();
this.tpCoinURL.SuspendLayout();
this.tpFileUploaders.SuspendLayout();
this.tcFileUploaders.SuspendLayout();
this.tpFTP.SuspendLayout();
@ -502,7 +504,6 @@ private void InitializeComponent()
this.tpPicasa.SuspendLayout();
this.tpChevereto.SuspendLayout();
this.tcUploaders.SuspendLayout();
this.tpCoinURL.SuspendLayout();
this.SuspendLayout();
//
// txtRapidSharePremiumUserName
@ -1261,6 +1262,25 @@ private void InitializeComponent()
resources.ApplyResources(this.lblLnkUAPIKey, "lblLnkUAPIKey");
this.lblLnkUAPIKey.Name = "lblLnkUAPIKey";
//
// tpCoinURL
//
this.tpCoinURL.Controls.Add(this.txtCoinURLUUID);
this.tpCoinURL.Controls.Add(this.lblCoinURLUUID);
resources.ApplyResources(this.tpCoinURL, "tpCoinURL");
this.tpCoinURL.Name = "tpCoinURL";
this.tpCoinURL.UseVisualStyleBackColor = true;
//
// txtCoinURLUUID
//
resources.ApplyResources(this.txtCoinURLUUID, "txtCoinURLUUID");
this.txtCoinURLUUID.Name = "txtCoinURLUUID";
this.txtCoinURLUUID.TextChanged += new System.EventHandler(this.txtCoinURLUUID_TextChanged);
//
// lblCoinURLUUID
//
resources.ApplyResources(this.lblCoinURLUUID, "lblCoinURLUUID");
this.lblCoinURLUUID.Name = "lblCoinURLUUID";
//
// tpFileUploaders
//
this.tpFileUploaders.Controls.Add(this.tcFileUploaders);
@ -1939,6 +1959,7 @@ private void InitializeComponent()
//
// tpOwnCloud
//
this.tpOwnCloud.Controls.Add(this.cbOwnCloud81Compatibility);
this.tpOwnCloud.Controls.Add(this.cbOwnCloudIgnoreInvalidCert);
this.tpOwnCloud.Controls.Add(this.cbOwnCloudDirectLink);
this.tpOwnCloud.Controls.Add(this.cbOwnCloudCreateShare);
@ -3467,24 +3488,12 @@ private void InitializeComponent()
this.actRapidShareAccountType.Name = "actRapidShareAccountType";
this.actRapidShareAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
//
// tpCoinURL
// cbOwnCloud81Compatibility
//
this.tpCoinURL.Controls.Add(this.txtCoinURLUUID);
this.tpCoinURL.Controls.Add(this.lblCoinURLUUID);
resources.ApplyResources(this.tpCoinURL, "tpCoinURL");
this.tpCoinURL.Name = "tpCoinURL";
this.tpCoinURL.UseVisualStyleBackColor = true;
//
// txtCoinURLUUID
//
resources.ApplyResources(this.txtCoinURLUUID, "txtCoinURLUUID");
this.txtCoinURLUUID.Name = "txtCoinURLUUID";
this.txtCoinURLUUID.TextChanged += new System.EventHandler(this.txtCoinURLUUID_TextChanged);
//
// lblCoinURLUUID
//
resources.ApplyResources(this.lblCoinURLUUID, "lblCoinURLUUID");
this.lblCoinURLUUID.Name = "lblCoinURLUUID";
resources.ApplyResources(this.cbOwnCloud81Compatibility, "cbOwnCloud81Compatibility");
this.cbOwnCloud81Compatibility.Name = "cbOwnCloud81Compatibility";
this.cbOwnCloud81Compatibility.UseVisualStyleBackColor = true;
this.cbOwnCloud81Compatibility.CheckedChanged += new System.EventHandler(this.cbOwnCloud81Compatibility_CheckedChanged);
//
// UploadersConfigForm
//
@ -3521,6 +3530,8 @@ private void InitializeComponent()
this.tpAdFly.PerformLayout();
this.tpLnkU.ResumeLayout(false);
this.tpLnkU.PerformLayout();
this.tpCoinURL.ResumeLayout(false);
this.tpCoinURL.PerformLayout();
this.tpFileUploaders.ResumeLayout(false);
this.tcFileUploaders.ResumeLayout(false);
this.tpFTP.ResumeLayout(false);
@ -3607,8 +3618,6 @@ private void InitializeComponent()
this.tpChevereto.ResumeLayout(false);
this.tpChevereto.PerformLayout();
this.tcUploaders.ResumeLayout(false);
this.tpCoinURL.ResumeLayout(false);
this.tpCoinURL.PerformLayout();
this.ResumeLayout(false);
}
@ -4024,5 +4033,6 @@ private void InitializeComponent()
private System.Windows.Forms.TabPage tpCoinURL;
private System.Windows.Forms.TextBox txtCoinURLUUID;
private System.Windows.Forms.Label lblCoinURLUUID;
private System.Windows.Forms.CheckBox cbOwnCloud81Compatibility;
}
}

View file

@ -532,6 +532,7 @@ public void LoadSettings(UploadersConfig uploadersConfig)
cbOwnCloudCreateShare.Checked = Config.OwnCloudCreateShare;
cbOwnCloudDirectLink.Checked = Config.OwnCloudDirectLink;
cbOwnCloudIgnoreInvalidCert.Checked = Config.OwnCloudIgnoreInvalidCert;
cbOwnCloud81Compatibility.Checked = Config.OwnCloud81Compatibility;
// MediaFire
@ -1884,6 +1885,11 @@ private void cbOwnCloudIgnoreInvalidCert_CheckedChanged(object sender, EventArgs
Config.OwnCloudIgnoreInvalidCert = cbOwnCloudIgnoreInvalidCert.Checked;
}
private void cbOwnCloud81Compatibility_CheckedChanged(object sender, EventArgs e)
{
Config.OwnCloud81Compatibility = cbOwnCloud81Compatibility.Checked;
}
#endregion ownCloud
#region Up1

File diff suppressed because it is too large Load diff

View file

@ -229,6 +229,7 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
public bool OwnCloudCreateShare = true;
public bool OwnCloudDirectLink = false;
public bool OwnCloudIgnoreInvalidCert = false;
public bool OwnCloud81Compatibility = false;
// MediaFire

View file

@ -981,7 +981,8 @@ public UploadResult UploadFile(Stream stream, string fileName)
Path = Program.UploadersConfig.OwnCloudPath,
CreateShare = Program.UploadersConfig.OwnCloudCreateShare,
DirectLink = Program.UploadersConfig.OwnCloudDirectLink,
IgnoreInvalidCert = Program.UploadersConfig.OwnCloudIgnoreInvalidCert
IgnoreInvalidCert = Program.UploadersConfig.OwnCloudIgnoreInvalidCert,
IsCompatibility81 = Program.UploadersConfig.OwnCloud81Compatibility
};
break;
case FileDestination.Pushbullet: