qBittorrent
|
#include "torrentfileswatcher.h"
#include <chrono>
#include <QtGlobal>
#include <QDir>
#include <QDirIterator>
#include <QFile>
#include <QFileSystemWatcher>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonValue>
#include <QSet>
#include <QTextStream>
#include <QThread>
#include <QTimer>
#include <QVariant>
#include "base/algorithm.h"
#include "base/bittorrent/magneturi.h"
#include "base/bittorrent/torrentcontentlayout.h"
#include "base/bittorrent/session.h"
#include "base/bittorrent/torrent.h"
#include "base/bittorrent/torrentinfo.h"
#include "base/exceptions.h"
#include "base/global.h"
#include "base/logger.h"
#include "base/profile.h"
#include "base/settingsstorage.h"
#include "base/tagset.h"
#include "base/utils/fs.h"
#include "base/utils/io.h"
#include "base/utils/string.h"
#include "torrentfileswatcher.moc"
Go to the source code of this file.
Classes | |
class | TorrentFilesWatcher::Worker |
Namespaces | |
anonymous_namespace{torrentfileswatcher.cpp} | |
Variables | |
const std::chrono::duration | WATCH_INTERVAL = 10s |
const int | MAX_FAILED_RETRIES = 5 |
const QString | CONF_FILE_NAME {QStringLiteral("watched_folders.json")} |
const QString | OPTION_ADDTORRENTPARAMS {QStringLiteral("add_torrent_params")} |
const QString | OPTION_RECURSIVE {QStringLiteral("recursive")} |
const QString | PARAM_CATEGORY {QStringLiteral("category")} |
const QString | PARAM_TAGS {QStringLiteral("tags")} |
const QString | PARAM_SAVEPATH {QStringLiteral("save_path")} |
const QString | PARAM_USEDOWNLOADPATH {QStringLiteral("use_download_path")} |
const QString | PARAM_DOWNLOADPATH {QStringLiteral("download_path")} |
const QString | PARAM_OPERATINGMODE {QStringLiteral("operating_mode")} |
const QString | PARAM_STOPPED {QStringLiteral("stopped")} |
const QString | PARAM_SKIPCHECKING {QStringLiteral("skip_checking")} |
const QString | PARAM_CONTENTLAYOUT {QStringLiteral("content_layout")} |
const QString | PARAM_AUTOTMM {QStringLiteral("use_auto_tmm")} |
const QString | PARAM_UPLOADLIMIT {QStringLiteral("upload_limit")} |
const QString | PARAM_DOWNLOADLIMIT {QStringLiteral("download_limit")} |
const QString | PARAM_SEEDINGTIMELIMIT {QStringLiteral("seeding_time_limit")} |
const QString | PARAM_RATIOLIMIT {QStringLiteral("ratio_limit")} |
const QString CONF_FILE_NAME {QStringLiteral("watched_folders.json")} |
Definition at line 69 of file torrentfileswatcher.cpp.
Referenced by TorrentFilesWatcher::load(), and TorrentFilesWatcher::store().
const int MAX_FAILED_RETRIES = 5 |
Definition at line 68 of file torrentfileswatcher.cpp.
Referenced by TorrentFilesWatcher::Worker::processFailedTorrents().
const QString OPTION_ADDTORRENTPARAMS {QStringLiteral("add_torrent_params")} |
Definition at line 71 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseWatchedFolderOptions(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeWatchedFolderOptions().
const QString OPTION_RECURSIVE {QStringLiteral("recursive")} |
Definition at line 72 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseWatchedFolderOptions(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeWatchedFolderOptions().
const QString PARAM_AUTOTMM {QStringLiteral("use_auto_tmm")} |
Definition at line 83 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseAddTorrentParams(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeAddTorrentParams().
const QString PARAM_CATEGORY {QStringLiteral("category")} |
Definition at line 74 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseAddTorrentParams(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeAddTorrentParams().
const QString PARAM_CONTENTLAYOUT {QStringLiteral("content_layout")} |
Definition at line 82 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseAddTorrentParams(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeAddTorrentParams().
const QString PARAM_DOWNLOADLIMIT {QStringLiteral("download_limit")} |
Definition at line 85 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseAddTorrentParams(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeAddTorrentParams().
const QString PARAM_DOWNLOADPATH {QStringLiteral("download_path")} |
Definition at line 78 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseAddTorrentParams(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeAddTorrentParams().
const QString PARAM_OPERATINGMODE {QStringLiteral("operating_mode")} |
Definition at line 79 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseAddTorrentParams(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeAddTorrentParams().
const QString PARAM_RATIOLIMIT {QStringLiteral("ratio_limit")} |
Definition at line 87 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseAddTorrentParams(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeAddTorrentParams().
const QString PARAM_SAVEPATH {QStringLiteral("save_path")} |
Definition at line 76 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseAddTorrentParams(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeAddTorrentParams().
const QString PARAM_SEEDINGTIMELIMIT {QStringLiteral("seeding_time_limit")} |
Definition at line 86 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseAddTorrentParams(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeAddTorrentParams().
const QString PARAM_SKIPCHECKING {QStringLiteral("skip_checking")} |
Definition at line 81 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseAddTorrentParams(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeAddTorrentParams().
const QString PARAM_STOPPED {QStringLiteral("stopped")} |
Definition at line 80 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseAddTorrentParams(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeAddTorrentParams().
const QString PARAM_TAGS {QStringLiteral("tags")} |
Definition at line 75 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseAddTorrentParams(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeAddTorrentParams().
const QString PARAM_UPLOADLIMIT {QStringLiteral("upload_limit")} |
Definition at line 84 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseAddTorrentParams(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeAddTorrentParams().
const QString PARAM_USEDOWNLOADPATH {QStringLiteral("use_download_path")} |
Definition at line 77 of file torrentfileswatcher.cpp.
Referenced by anonymous_namespace{torrentfileswatcher.cpp}::parseAddTorrentParams(), and anonymous_namespace{torrentfileswatcher.cpp}::serializeAddTorrentParams().
const std::chrono::duration WATCH_INTERVAL = 10s |