Browse Source

Merge pull request #7475 from thalieht/ratiosuperseed

Add option to enable Super Seeding mode once ratio/time limit is reached. Closes #7160.
adaptive-webui-19844
Mike Tzou 5 years ago committed by GitHub
parent
commit
767f024585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      src/base/bittorrent/session.cpp
  2. 3
      src/base/bittorrent/session.h
  3. 11
      src/gui/optionsdialog.ui
  4. 1
      src/webui/www/private/preferences_content.html

12
src/base/bittorrent/session.cpp

@ -1535,10 +1535,14 @@ void Session::processShareLimits() @@ -1535,10 +1535,14 @@ void Session::processShareLimits()
LogMsg(tr("'%1' reached the maximum ratio you set. Removed.").arg(torrent->name()));
deleteTorrent(torrent->hash());
}
else if (!torrent->isPaused()) {
else if ((m_maxRatioAction == Pause) && !torrent->isPaused()) {
torrent->pause();
LogMsg(tr("'%1' reached the maximum ratio you set. Paused.").arg(torrent->name()));
}
else if ((m_maxRatioAction == EnableSuperSeeding) && !torrent->isPaused() && !torrent->superSeeding()) {
torrent->setSuperSeeding(true);
LogMsg(tr("'%1' reached the maximum ratio you set. Enabled super seeding for it.").arg(torrent->name()));
}
continue;
}
}
@ -1558,10 +1562,14 @@ void Session::processShareLimits() @@ -1558,10 +1562,14 @@ void Session::processShareLimits()
LogMsg(tr("'%1' reached the maximum seeding time you set. Removed.").arg(torrent->name()));
deleteTorrent(torrent->hash());
}
else if (!torrent->isPaused()) {
else if ((m_maxRatioAction == Pause) && !torrent->isPaused()) {
torrent->pause();
LogMsg(tr("'%1' reached the maximum seeding time you set. Paused.").arg(torrent->name()));
}
else if ((m_maxRatioAction == EnableSuperSeeding) && !torrent->isPaused() && !torrent->superSeeding()) {
torrent->setSuperSeeding(true);
LogMsg(tr("'%1' reached the maximum seeding time you set. Enabled super seeding for it.").arg(torrent->name()));
}
}
}
}

3
src/base/bittorrent/session.h

@ -62,7 +62,8 @@ class ResumeDataSavingManager; @@ -62,7 +62,8 @@ class ResumeDataSavingManager;
enum MaxRatioAction
{
Pause,
Remove
Remove,
EnableSuperSeeding
};
enum TorrentExportFolder

11
src/gui/optionsdialog.ui

@ -2443,9 +2443,6 @@ @@ -2443,9 +2443,6 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="suffix">
<string extracomment="minutes"> min</string>
</property>
@ -2489,6 +2486,11 @@ @@ -2489,6 +2486,11 @@
<string>Remove them</string>
</property>
</item>
<item>
<property name="text">
<string>Enable super seeding for them</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
@ -2503,9 +2505,6 @@ @@ -2503,9 +2505,6 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignHCenter</set>
</property>
<property name="maximum">
<double>9998.000000000000000</double>
</property>

1
src/webui/www/private/preferences_content.html

@ -579,6 +579,7 @@ @@ -579,6 +579,7 @@
<select id="max_ratio_act">
<option value="0">QBT_TR(Pause them)QBT_TR[CONTEXT=OptionsDialog]</option>
<option value="1">QBT_TR(Remove them)QBT_TR[CONTEXT=OptionsDialog]</option>
<option value="2">QBT_TR(Enable super seeding for them)QBT_TR[CONTEXT=OptionsDialog]</option>
</select>
</td>
</tr>

Loading…
Cancel
Save