mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
Merge pull request #6475 from OpenGG/master
[WebUI-API] Add "skip_checking" and "paused" to "/command/download" and "/command/upload"
This commit is contained in:
commit
018574e546
6 changed files with 44 additions and 4 deletions
|
@ -367,6 +367,8 @@ void WebApplication::action_command_download()
|
|||
CHECK_URI(0);
|
||||
QString urls = request().posts["urls"];
|
||||
QStringList list = urls.split('\n');
|
||||
bool skipChecking = request().posts["skip_checking"] == "true";
|
||||
bool addPaused = request().posts["paused"] == "true";
|
||||
QString savepath = request().posts["savepath"];
|
||||
QString category = request().posts["category"];
|
||||
QString cookie = request().posts["cookie"];
|
||||
|
@ -390,6 +392,11 @@ void WebApplication::action_command_download()
|
|||
category = category.trimmed();
|
||||
|
||||
BitTorrent::AddTorrentParams params;
|
||||
|
||||
// TODO: Check if destination actually exists
|
||||
params.skipChecking = skipChecking;
|
||||
|
||||
params.addPaused = addPaused;
|
||||
params.savePath = savepath;
|
||||
params.category = category;
|
||||
|
||||
|
@ -406,6 +413,8 @@ void WebApplication::action_command_upload()
|
|||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
CHECK_URI(0);
|
||||
bool skipChecking = request().posts["skip_checking"] == "true";
|
||||
bool addPaused = request().posts["paused"] == "true";
|
||||
QString savepath = request().posts["savepath"];
|
||||
QString category = request().posts["category"];
|
||||
|
||||
|
@ -423,6 +432,11 @@ void WebApplication::action_command_upload()
|
|||
}
|
||||
else {
|
||||
BitTorrent::AddTorrentParams params;
|
||||
|
||||
// TODO: Check if destination actually exists
|
||||
params.skipChecking = skipChecking;
|
||||
|
||||
params.addPaused = addPaused;
|
||||
params.savePath = savepath;
|
||||
params.category = category;
|
||||
if (!BitTorrent::Session::instance()->addTorrent(torrentInfo, params)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue