mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
Add auto torrent management to webui context menu (addresses #6815)
This commit is contained in:
parent
e2893fe68f
commit
771033a449
7 changed files with 59 additions and 0 deletions
|
@ -122,6 +122,7 @@ QMap<QString, QMap<QString, WebApplication::Action> > WebApplication::initialize
|
|||
ADD_ACTION(command, bottomPrio);
|
||||
ADD_ACTION(command, setLocation);
|
||||
ADD_ACTION(command, rename);
|
||||
ADD_ACTION(command, setAutoTMM);
|
||||
ADD_ACTION(command, recheck);
|
||||
ADD_ACTION(command, setCategory);
|
||||
ADD_ACTION(command, addCategory);
|
||||
|
@ -822,6 +823,21 @@ void WebApplication::action_command_rename()
|
|||
}
|
||||
}
|
||||
|
||||
void WebApplication::action_command_setAutoTMM()
|
||||
{
|
||||
CHECK_URI(0);
|
||||
CHECK_PARAMETERS("hashes" << "enable");
|
||||
|
||||
QStringList hashes = request().posts["hashes"].split("|");
|
||||
QString enableStr = request().posts["enable"];
|
||||
|
||||
foreach (const QString &hash, hashes) {
|
||||
BitTorrent::TorrentHandle *const torrent = BitTorrent::Session::instance()->findTorrent(hash);
|
||||
if (torrent)
|
||||
torrent->setAutoTMMEnabled(enableStr == "true");
|
||||
}
|
||||
}
|
||||
|
||||
void WebApplication::action_command_recheck()
|
||||
{
|
||||
CHECK_URI(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue