diff --git a/Source/RatioMaster/RM.Designer.cs b/Source/RatioMaster/RM.Designer.cs index 87eaac1..d2c8475 100644 --- a/Source/RatioMaster/RM.Designer.cs +++ b/Source/RatioMaster/RM.Designer.cs @@ -128,6 +128,7 @@ internal void InitializeComponent() this.checkIgnoreFailureReason = new System.Windows.Forms.CheckBox(); this.checkRequestScrap = new System.Windows.Forms.CheckBox(); this.checkTCPListen = new System.Windows.Forms.CheckBox(); + this.noLeechers = new System.Windows.Forms.CheckBox(); this.magneticPanel1 = new RatioMaster_source.MagneticPanel(); this.browseButton = new System.Windows.Forms.Button(); this.torrentFile = new System.Windows.Forms.TextBox(); @@ -650,6 +651,7 @@ internal void InitializeComponent() this.magneticPanel6.Controls.Add(this.cmbClient); this.magneticPanel6.Controls.Add(this.interval); this.magneticPanel6.Controls.Add(this.ClientLabel); + this.magneticPanel6.Controls.Add(this.noLeechers); this.magneticPanel6.ExpandSize = new System.Drawing.Size(473, 70); this.magneticPanel6.Location = new System.Drawing.Point(3, 207); this.magneticPanel6.Marker = RatioMaster_source.PanelMarkerStyle.Arrow; @@ -1197,6 +1199,18 @@ internal void InitializeComponent() this.checkTCPListen.Text = "Use TCP listener"; this.checkTCPListen.UseVisualStyleBackColor = true; // + // noLeechers + this.noLeechers.AutoSize = true; + this.noLeechers.Checked = true; + this.noLeechers.CheckState = System.Windows.Forms.CheckState.Checked; + this.noLeechers.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.noLeechers.Location = new System.Drawing.Point(342, 50); + this.noLeechers.Name = "noLeechers"; + this.noLeechers.Size = new System.Drawing.Size(102, 17); + this.noLeechers.TabIndex = 0; + this.noLeechers.Text = "Stop if no leechers"; + this.noLeechers.UseVisualStyleBackColor = true; + // // magneticPanel1 // this.magneticPanel1.BevelStyle = RatioMaster_source.BevelStyles.Flat; @@ -1316,6 +1330,7 @@ internal void InitializeComponent() internal System.Windows.Forms.TextBox txtStopValue; internal System.Windows.Forms.Label lblRemWork; internal System.Windows.Forms.CheckBox checkTCPListen; + internal System.Windows.Forms.CheckBox noLeechers; internal System.Windows.Forms.CheckBox checkRequestScrap; internal System.Windows.Forms.Button btnDefault; internal System.Windows.Forms.Label labelProxyType; diff --git a/Source/RatioMaster/RM.cs b/Source/RatioMaster/RM.cs index 947d940..4130675 100644 --- a/Source/RatioMaster/RM.cs +++ b/Source/RatioMaster/RM.cs @@ -935,7 +935,7 @@ private bool sendEventToTracker(TorrentInfo torrentInfo, string eventType) updateScrapStats(BEncode.String(dictionary1["complete"]), BEncode.String(dictionary1["incomplete"]), ""); decimal leechers = BEncode.String(dictionary1["incomplete"]).ParseValidInt(0); - if (leechers == 0) + if (leechers == 0 && noLeechers.Checked) { AddLogLine("Min number of leechers reached... setting upload speed to 0"); updateTextBox(uploadRate, "0"); @@ -1134,7 +1134,7 @@ private void requestScrapeFromTracker(TorrentInfo torrentInfo) AddLogLine("incomplete: " + BEncode.String(dictionary2["incomplete"])); updateScrapStats(BEncode.String(dictionary2["complete"]), BEncode.String(dictionary2["incomplete"]), BEncode.String(dictionary2["downloaded"])); decimal leechers = BEncode.String(dictionary2["incomplete"]).ParseValidInt(-1); - if (Leechers != -1 && (leechers == 0)) + if (Leechers != -1 && (leechers == 0) && noLeechers.Checked) { AddLogLine("Min number of leechers reached... setting upload speed to 0"); updateTextBox(uploadRate, "0");