mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-22 22:33:34 -07:00
fix: changes from comments
This commit is contained in:
parent
ec170fa572
commit
cab6b42d43
1 changed files with 5 additions and 5 deletions
|
@ -305,7 +305,7 @@ void TorrentsController::countAction()
|
||||||
// - tag (string): torrent tag for filtering by it (empty string means "untagged"; no "tag" param presented means "any tag")
|
// - tag (string): torrent tag for filtering by it (empty string means "untagged"; no "tag" param presented means "any tag")
|
||||||
// - hashes (string): filter by hashes, can contain multiple hashes separated by |
|
// - hashes (string): filter by hashes, can contain multiple hashes separated by |
|
||||||
// - private (bool): filter torrents that are from private trackers (true) or not (false). Empty means any torrent (no filtering)
|
// - private (bool): filter torrents that are from private trackers (true) or not (false). Empty means any torrent (no filtering)
|
||||||
// - includeTrackers (bool): include trackers in list outout (true) or not (false). Empty means not included
|
// - includeTrackers (bool): include trackers in list output (true) or not (false). Empty means not included
|
||||||
// - sort (string): name of column for sorting by its value
|
// - sort (string): name of column for sorting by its value
|
||||||
// - reverse (bool): enable reverse sorting
|
// - reverse (bool): enable reverse sorting
|
||||||
// - limit (int): set limit number of torrents returned (if greater than 0, otherwise - unlimited)
|
// - limit (int): set limit number of torrents returned (if greater than 0, otherwise - unlimited)
|
||||||
|
@ -321,7 +321,7 @@ void TorrentsController::infoAction()
|
||||||
int offset {params()[u"offset"_s].toInt()};
|
int offset {params()[u"offset"_s].toInt()};
|
||||||
const QStringList hashes {params()[u"hashes"_s].split(u'|', Qt::SkipEmptyParts)};
|
const QStringList hashes {params()[u"hashes"_s].split(u'|', Qt::SkipEmptyParts)};
|
||||||
const std::optional<bool> isPrivate = parseBool(params()[u"private"_s]);
|
const std::optional<bool> isPrivate = parseBool(params()[u"private"_s]);
|
||||||
const std::optional<bool> includeTrackers = parseBool(params()[u"includeTrackers"_s]);
|
const bool includeTrackers = parseBool(params()[u"includeTrackers"_s]).value_or(false);
|
||||||
|
|
||||||
std::optional<TorrentIDSet> idSet;
|
std::optional<TorrentIDSet> idSet;
|
||||||
if (!hashes.isEmpty())
|
if (!hashes.isEmpty())
|
||||||
|
@ -335,8 +335,9 @@ void TorrentsController::infoAction()
|
||||||
QVariantList torrentList;
|
QVariantList torrentList;
|
||||||
for (const BitTorrent::Torrent *torrent : asConst(BitTorrent::Session::instance()->torrents()))
|
for (const BitTorrent::Torrent *torrent : asConst(BitTorrent::Session::instance()->torrents()))
|
||||||
{
|
{
|
||||||
if (torrentFilter.match(torrent))
|
if (!torrentFilter.match(torrent))
|
||||||
{
|
continue;
|
||||||
|
|
||||||
QVariantMap serializedTorrent = serialize(*torrent);
|
QVariantMap serializedTorrent = serialize(*torrent);
|
||||||
|
|
||||||
if (includeTrackers)
|
if (includeTrackers)
|
||||||
|
@ -366,7 +367,6 @@ void TorrentsController::infoAction()
|
||||||
|
|
||||||
torrentList.append(serializedTorrent);
|
torrentList.append(serializedTorrent);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (torrentList.isEmpty())
|
if (torrentList.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue