Allow to add root folder to torrent content

This commit is contained in:
Vladimir Golovnev (Glassez) 2020-12-10 09:54:27 +03:00
parent d4a51979bb
commit 1d5dc283fe
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
30 changed files with 452 additions and 172 deletions

View file

@ -56,6 +56,7 @@
#include "base/utils/misc.h"
#include "base/utils/net.h"
#include "base/utils/password.h"
#include "base/utils/string.h"
#include "../webapplication.h"
void AppController::webapiVersionAction()
@ -100,7 +101,7 @@ void AppController::preferencesAction()
// Downloads
// When adding a torrent
data["create_subfolder_enabled"] = session->isKeepTorrentTopLevelFolder();
data["torrent_content_layout"] = Utils::String::fromEnum(session->torrentContentLayout());
data["start_paused_enabled"] = session->isAddTorrentPaused();
data["auto_delete_mode"] = static_cast<int>(TorrentFileGuard::autoDeleteMode());
data["preallocate_all"] = session->isPreallocationEnabled();
@ -355,8 +356,8 @@ void AppController::setPreferencesAction()
// Downloads
// When adding a torrent
if (hasKey("create_subfolder_enabled"))
session->setKeepTorrentTopLevelFolder(it.value().toBool());
if (hasKey("torrent_content_layout"))
session->setTorrentContentLayout(Utils::String::toEnum(it.value().toString(), BitTorrent::TorrentContentLayout::Original));
if (hasKey("start_paused_enabled"))
session->setAddTorrentPaused(it.value().toBool());
if (hasKey("auto_delete_mode"))