1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 07:18:08 +00:00

Return status indicating if at least one torrent was successfully added

This commit is contained in:
Thomas Piccirello 2017-05-15 14:30:44 -04:00
parent a2d5d48aff
commit 7cf1d844b0

View File

@ -400,13 +400,19 @@ void WebApplication::action_command_download()
params.savePath = savepath;
params.category = category;
bool partialSuccess = false;
foreach (QString url, list) {
url = url.trimmed();
if (!url.isEmpty()) {
Net::DownloadManager::instance()->setCookiesFromUrl(cookies, QUrl::fromEncoded(url.toUtf8()));
BitTorrent::Session::instance()->addTorrent(url, params);
partialSuccess |= BitTorrent::Session::instance()->addTorrent(url, params);
}
}
if (partialSuccess)
print(QByteArray("Ok."), Http::CONTENT_TYPE_TXT);
else
print(QByteArray("Fails."), Http::CONTENT_TYPE_TXT);
}
void WebApplication::action_command_upload()