mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
Add ability to set super seeding mode for torrents
This commit is contained in:
parent
28f573e9a8
commit
facab1681a
7 changed files with 49 additions and 0 deletions
|
@ -102,6 +102,7 @@ QMap<QString, QMap<QString, WebApplication::Action> > WebApplication::initialize
|
|||
ADD_ACTION(command, toggleAlternativeSpeedLimits);
|
||||
ADD_ACTION(command, toggleSequentialDownload);
|
||||
ADD_ACTION(command, toggleFirstLastPiecePrio);
|
||||
ADD_ACTION(command, setSuperSeeding);
|
||||
ADD_ACTION(command, delete);
|
||||
ADD_ACTION(command, deletePerm);
|
||||
ADD_ACTION(command, increasePrio);
|
||||
|
@ -541,6 +542,21 @@ void WebApplication::action_command_toggleFirstLastPiecePrio()
|
|||
}
|
||||
}
|
||||
|
||||
void WebApplication::action_command_setSuperSeeding()
|
||||
{
|
||||
CHECK_URI(0);
|
||||
CHECK_PARAMETERS("hashes" << "value");
|
||||
bool value = request().posts["value"] == "true";
|
||||
QStringList hashes = request().posts["hashes"].split("|");
|
||||
foreach (const QString &hash, hashes) {
|
||||
try {
|
||||
QTorrentHandle h = QBtSession::instance()->getTorrentHandle(hash);
|
||||
h.super_seeding(value);
|
||||
}
|
||||
catch(invalid_handle&) {}
|
||||
}
|
||||
}
|
||||
|
||||
void WebApplication::action_command_delete()
|
||||
{
|
||||
CHECK_URI(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue