Skip to content

Commit

Permalink
fix: setTags compilation err
Browse files Browse the repository at this point in the history
  • Loading branch information
zze0s committed Jan 21, 2025
1 parent d72507d commit b63f574
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/webui/api/torrentscontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1482,15 +1482,16 @@ void TorrentsController::setTagsAction()
const QStringList hashes {params()[u"hashes"_s].split(u'|', Qt::SkipEmptyParts)};
const QStringList tags {params()[u"tags"_s].split(u',', Qt::SkipEmptyParts)};

TagSet newTags {tags.begin(), tags.end()};
applyToTorrents(hashes, [newTags](BitTorrent::Torrent *const torrent)
const TagSet newTags {tags.begin(), tags.end()};
applyToTorrents(hashes, [&newTags](BitTorrent::Torrent *const torrent)
{
TagSet tmpTags {newTags};
for (const Tag &tag : asConst(torrent->tags()))
{
if (newTags.erase(tag) == 0)
if (tmpTags.erase(tag) == 0)
torrent->removeTag(tag);
}
for (const Tag &tag : newTags)
for (const Tag &tag : tmpTags)
torrent->addTag(tag);
});
}
Expand Down

0 comments on commit b63f574

Please sign in to comment.