Use the correct type when referring to info hash

This commit is contained in:
Chocobo1
2020-11-30 14:39:03 +08:00
parent 3485ad39d9
commit 9f0429ca6f
12 changed files with 152 additions and 160 deletions

View File

@@ -256,10 +256,14 @@ void TorrentsController::infoAction()
const bool reverse {parseBool(params()["reverse"], false)};
int limit {params()["limit"].toInt()};
int offset {params()["offset"].toInt()};
const QStringSet hashSet {List::toSet(params()["hashes"].split('|', QString::SkipEmptyParts))};
const QStringList hashes {params()["hashes"].split('|', QString::SkipEmptyParts)};
InfoHashSet hashSet;
for (const QString &hash : hashes)
hashSet.insert(BitTorrent::InfoHash {hash});
QVariantList torrentList;
TorrentFilter torrentFilter(filter, (hashSet.isEmpty() ? TorrentFilter::AnyHash : hashSet), category);
TorrentFilter torrentFilter(filter, (hashes.isEmpty() ? TorrentFilter::AnyHash : hashSet), category);
for (BitTorrent::TorrentHandle *const torrent : asConst(BitTorrent::Session::instance()->torrents()))
{
if (torrentFilter.match(torrent))